[TYPO3-english] Solved: TypoScriptObjectPath - positioning an image

Kay Obermueller kay.obermueller at mail.ru
Sat Sep 24 21:01:26 CEST 2011


On 09/24/2011 01:49 PM, Kay Obermueller wrote:
> Hi all,
> at the top of my website I have a div container with an image in it. I
> want to place it horizontally at the center. As in CSS with IMG.displayed
> {display: block; margin-left: auto; margin-right: auto}.
> I used Templavoila and defined that div container as TypoScriptObjectPath.
> In the TypoScript Template I can set the size of the image with this:
> lib.logo.file.height = 150. Also I can already place my image vertically
> with padding in CSS.
> But how can I assign the image to CSS-class "displayed" to obey my
> horizontal CSS defintions as it sticks stubbornly at the left side? Or how
> else could this be done?
> Thank you in advance.
>

With this CSS:

img.logopic
{
    display: block;
    margin-left: auto;
    margin-right: auto
}

This code within the TypoScript template does work:

lib.logo = TEXT
lib.logo.value = <img src="fileadmin/templates/images/logopic.jpg"
alt="Logo" title="Logo" class="logopic" border="0">

This doesn't work, the class and all params are ignored:

lib.logo = IMAGE
lib.logo {
  file = fileadmin/templates/images/logopic.jpg
  params = alt = "Logo" class = "logopic" title = "Logo"
}

Kay





More information about the TYPO3-english mailing list