Adding the page content to a fluid template

醉酒当歌 提交于 2019-12-03 22:45:30

On your question which approach is more elegant (I don't use fluid, but I think it's general Typoscript):

If you want to use css_styled_content, but with more flexibility and transparence than the shortcuts "get", "getLeft" etc., use this:

content < styles.content.get
content.select.where = colPos = 0

No need to specify content = CONTENT in that case.

In the way you wrote it above, you would probably need to add:

10.parseFunc = < lib.parseFunc_RTE

to your renderObj, as else, automatically linked e-Mail addresses etc. won't be rendered in the content.

If you want full control over the markup, your original approach using the CONTENT object is superior to css_styled_content. But you will have to cover each field the editors are supposed to use.

I always use this article: http://www.typo3wizard.com/en/articles/explaining-the-content-object.html

With css_styled_content on the other hand, you get parsing for all fields for free - but also you get all the markup it will write for you.

It might be helpful to look at csc's static template in /typo3/sysext/css_styled_content/static/setup.txt to see what it does.

i dont use fluid, just plain TS for my projects, but i hope ill help.

In backend the cols are like this if u have not "touched" em:

| col1(Left) | col0(Normal) | col2(Right) | col3(Border) |

What i do is this for "normal" layout:

page.10 = TEMPLATE
page.10 {
  subparts{
    LEFT-CONTENT < styles.content.getLeft
    CONTENT < styles.content.get
    RIGHT-CONTENT < styles.content.getRight
  }
  marks {
    DESCRIPTION < styles.content.getBorder
  }

If u need something more u can use something like this to generate some content that is not on that page and can use it to display it on all pages.

subparts{
LEFT-CONTENT < styles.content.getLeft
LEFT-CONTENT {
  select.pidInList = 50
  select.where = colPos=0
  select.orderBy = sorting
  wrap = <div class="col100">|</div>
}

page.5.variables.content < styles.content.get

Of course you must have the CSS styled content extension installed (default) and the static template "CSS Styled content" included in your TypoScript Template (Tab: Includes).

Alternative solution: https://fluidtypo3.org/viewhelpers/vhs/development/Content/RenderViewHelper.html (along with get and random get/render counterparts).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!