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

Sergey Alexandrov serg at alexandrov.us
Sat Sep 24 22:23:00 CEST 2011


Just tried your example (inserted as a page content at my test site), 
works fine (4.5.6, no TV, sorry)

page.10.subparts.PAGE_CONTENT>
page.10.subparts.PAGE_CONTENT=IMAGE
page.10.subparts.PAGE_CONTENT{
file=uploads/tf/logo.gif
params=alt="Logo"class="logopic"title="Logo"
   // If you need border, add line below, not into params
   border = 1
}

result: <img width="309" height="60" border="0" title="Logo" 
class="logopic" alt="Logo" src="uploads/tf/logo.gif">

Maybe somewhere else to dig?

Thanx

On 9/24/2011 3:01 PM, Kay Obermueller wrote:
> 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
>
>
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list