[TYPO3-ttnews] Rendering a news overview

Oliver Salzburg oliver.salzburg at googlemail.com
Fri Feb 17 12:24:37 CET 2012


On 2012-02-14 18:52, Georg Ringer wrote:
> Am 13.02.2012 11:19, schrieb Oliver Salzburg:
>> Maybe I'm misinterpreting what you're saying
> 
> not that easy coming together... ;) are you at t3board or t3dd?

I should look into it, that's for sure :)

>> but, are you suggesting I
>> use conditions for all my different templating needs, in a single
>> template?
> 
> this is what you can of course do and is very fast as the templates
> would be still very small when using partials.
> 
>> While I assume that that would work just fine for now, it seems like
>> that would clutter the markup substantially.
> 
> it really depends but IMO it is a suitable way.

I went with this approach and the result is a lot "better" than what I
expected.

>> I'm still wondering if it could help me solve my issue. Not really sure
>> where I could go from here with this.
> 
> it makes it possible to render a selectbox with different template
> options which you then can check in the template using a f:if condition=""

For now, I'll just ignore this option. I still don't understand what I
could actually use it for. It doesn't seem to be the solution to my
problem. That's for sure.

>> I guess I could now also go ahead and configure
>> lib.file_navigation to take a different partialRootPath, so the news on
>> my target page are rendered as headlines only... Or couldn't I? Sounds
>> like a bad idea to keep copying folders around.
> 
> sure you could do that but if most things are the same I would go with a
> condition inside one template set and not duplicating everything

Ok, so for now I approach the issue like this:
[globalVar = TSFE:id = 5]
lib.field_subnavigation < tt_content.list.20.news_pi1
lib.field_subnavigation {
  switchableControllerActions {
    News {
      1 = list
    }
  }
  settings < plugin.tx_news.settings
  settings {
    //categories = 49
    limit = 30
    detailPid = 18
    overrideFlexformSettingsIfEmpty := addToList(detailPid)
    startingpoint = 9
    renderSummary = 1
  }
}
[end]

This way, were previously I had a menu, I now have my news.
And by settings settings.renderSummary (which I made up), I can check
for that in the Item.html template and adjust my rendering accordingly.
Great.

Just one more question if I may. Let's assume I didn't know about forge
and the article where I took the above TypoScript from.
How would I determine that tt_content.list.20.news_pi1 contains what I'm
looking for? How can I determine what it even is or where it was
defined?
If I just know "I want to put news into that TS definition", how do I
end up with the answer "tt_content.list.20.news_pi1"?

Cheers
Oliver


More information about the TYPO3-project-tt-news mailing list