1
votes

Could someone help me with TypoScript?

Google and SO gave me no clue on this problem.

I have a following situation. I'm using fluid templates and TS to get one a content item from one source on every page.

lib.footer_video_content = RECORDS
lib.footer_video_content {
    tables = tt_content
    source = 11
}

The content element is an Image list (textpic type).

Code works fine. It grabs the element fine but I don't know how to apply a different layout for only that one element.

I may following to the global template setup

tt_content.image.20 {
    imageStdWrap.dataWrap = ...
    imageStdWrapNoWidth.wrap = ...
    #... etc
}

But this would change wrapping for every element on the page.

Any help would be great, thanks.

2

2 Answers

3
votes

Use a CONTENT content object instead of a RECORDS content object, and then use the renderObj property to render your content element.

lib.footer_video_content = CONTENT
lib.footer_video_content {
    table = tt_content
    select {
        uidInList = 11
        pidInList = <Page ID where the content element is>

        languageField = sys_language_uid

        # Add more settings if needed
    }

    # This renderObj just renders the header of the content element
    # You could also copy the rendering definition from tt_content and
    # modify it, e.g.
    #   renderObj < tt_content
    #   renderObj.image.20 {
    #     imageStdWrap.dataWrap = ...
    #   }
    renderObj = TEXT
    renderObj {
        data.field = header
    }
}
1
votes

I make this with a custom div wrapper (frame):

tt_content.stdWrap.innerWrap.cObject = CASE
tt_content.stdWrap.innerWrap.cObject {

  key.field = section_frame

  # Delete standard wraps

  1 >
  5 >
  6 >
  10 >
  11 >
  12 >
  20 >
  21 >

  # Define new wraps

  101 >
  101 = TEXT
  101.value = <div id="yourwrap">|</div>
}

AND

TCEFORM.tt_content.section_frame {

  removeItems = 1,2,3,4,5,6,7,8,9,10,11,12,20,21

  addItems.101 = My new wrap

}

Now you can select your wrapper(frame) in the selectbox of your contentelement LOOK here: http://www.digiblog.de/2010/10/custom-frames-for-typo3-content-elements/

Now you can Style this one element in css!