benjaminkott / bootstrap_package

Bootstrap Package delivers a full configured theme for TYPO3, based on the Bootstrap CSS Framework.
https://www.bootstrap-package.com/
MIT License
338 stars 207 forks source link

[Question] lib.dynamicContent: How to fetch only certain fields? #945

Open vigri opened 4 years ago

vigri commented 4 years ago

Support

Description

Hello,

I would like to ask if it's possible to fetch only certian fields with lib.dynamicContent

Something like <f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '1', field: 'subheader'}" />

This is the relevant part inside my fluid template

<h1 class="p-1">XXX HEADER XXX</h1>
<p class="lead p-1 font-weight-bold">XXX SUBHEADER XXX</p>

I've tried to modify lib.dynamicContent and add for instance lib.dynamicContent.20.select.selectFields = header

This unfortunately results in an error: ERROR: Content Element with uid "5" and type "" has no rendering definition!

Thanks in advance and best regards

gilbertsoft commented 4 years ago

Hey @vigri, what exactly are you trying to achieve?

vigri commented 4 years ago

Hey @gilbertsoft,

I'm using lib.dynamicContent in my own project. On my root page I've a content element of type "only header" where the header and subheader are filled out.

Both parts should now be inserted in my fluid template.

If I only use <f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '1'}" /> I've no control about the individual elements (header / subheader). Therefore I would like to "split" them and get rid of the standard wrapping.

I hope my intention is clearer now, even if I think that it is not the best practice.

Thank you and best regards

gilbertsoft commented 4 years ago

Yeah, that's I was guessing. Did you create the CE by your own? The default header element does this already see images.

grafik grafik

The partials used you can find here https://github.com/benjaminkott/bootstrap_package/tree/master/Resources/Private/Partials/ContentElements/Header. As with every Fluid template you can use a Sitepackage to change the templates.