0

Using the extension news I implemented three list views on one page with different colPos. Now I need to make some different settings for each list view. I would prefer doing this via TypoScript. Is there a solution for this?

Many thanks and best regards!

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
cermit
  • 1
  • 1
  • All settings could be of type *stdWrap*. With stdWrap, you could use any cObject including *CASE*, *override* and/or *if*. For a few settings, this might work, for many settings, it could get confusing. https://docs.typo3.org/p/georgringer/news/main/en-us/Reference/TypoScript/GeneralSettings.html?highlight=stdwrap#usestdwrap – Julian Hofmann Feb 17 '23 at 07:30
  • Maybe *templateLayouts* can also solve your use-case. Instead of settings via TS, maybe some could be hard-coded in the template. (https://docs.typo3.org/p/georgringer/news/main/en-us/Reference/TsConfig/General.html#templatelayouts) – Julian Hofmann Feb 17 '23 at 07:32

1 Answers1

0

It really depends which settings you need. One easy solution could be something like thins

plugin.tx_news.settings {
  mainCol {
    setting = abc
  }
  leftCol {
   setting = def
  }
}

and in the fluid templates

<f:if condition="{contentObjectData.colPos} == 3">
  <f:then><f:variable name="mySettings">{settings.mainCol}</f:then>
  <f:else><f:variable name="mySettings">{settings.leftCol}</f:else>
</f:if>
<f:render section="list" arguments="{_all}" />
<f:section name="list">
... do your stuff here
{mySettings -> f:debug(inline:1)}
</f:section>
Georg Ringer
  • 7,779
  • 1
  • 16
  • 34
  • Thank you very much for your help! I understand how the variable mySettings is set, but as a beginner of typo3 I don’t understand how the settings are given to the plugin: Via {mySettings -> f:debug(in-line:1)}. Or is this line just set for debugging? I tried to research, but I didn’t get the trick. – cermit Feb 18 '23 at 06:52
  • 123 is just a vh which sets a variable which can be later used to a value. the settings.mainCol is set in TS and everything with settings as previews is added to the fluid template automatically – Georg Ringer Feb 19 '23 at 21:01
  • feel free to ask more, maybe in slack as it is sometimes a bit easier to support – Georg Ringer Feb 19 '23 at 21:01
  • Many thanks for your support again! But I'm still struggling ... In theory I understand your solution, but obviously I still make mistakes. To make things easier I just tried to set the variable mySettings `{settings}` and set `{_all}`. Unfortunatley mySettings is NULL. It seems that {settings} has no content. I pasted the code in the partial which renders the maincontent of my sitepackage. – cermit Mar 03 '23 at 14:30