flux icon indicating copy to clipboard operation
flux copied to clipboard

allowedContentTypes doesn't work for page templates

Open sebastianschrama opened this issue 5 years ago • 10 comments

No matter what I do, I always get all content elements displayed in the new content element wizard.

This is my setup:

TYPO3 8.7.26 flux 9.2.0 fluidpages 5.0.0

Page.html

<f:layout name="Page" />

<f:section name="Configuration">
    <flux:form id="standardWithMenuTeasers">
        <flux:grid>
            <flux:grid.row>
                <flux:grid.column colPos="1337" name="menuTeaserFirst">
                    <flux:form.variable name="allowedContentTypes" value="fluidcontent_content"/>
                    <flux:form.variable name="Fluidcontent" value="{allowedContentTypes: 'Ueberdosis.Ueberdosisprovider:Box.html'}"/>
                </flux:grid.column>
                <flux:grid.column colPos="1338" name="menuTeaserSecond">
                    <flux:form.variable name="allowedContentTypes" value="fluidcontent_content"/>
                    <flux:form.variable name="Fluidcontent" value="{allowedContentTypes: 'Ueberdosis.Ueberdosisprovider:Box.html'}"/>
                </flux:grid.column>
            </flux:grid.row>
            <flux:grid.row>
                <flux:grid.column colspan="2" colPos="0" name="main" />
            </flux:grid.row>
        </flux:grid>
    </flux:form>
</f:section>

<f:section name="Main">
    <f:render partial="Page" arguments="{_all}" />
</f:section>

This doesn't work either by the way:

<f:layout name="Page" />

<f:section name="Configuration">
    <flux:form id="standardWithMenuTeasers">
        <flux:grid>
            <flux:grid.row>
                <flux:grid.column colPos="1337" name="menuTeaserFirst">
                    <flux:form.variable name="allowedContentTypes" value="textmedia"/>
                </flux:grid.column>
                <flux:grid.column colPos="1338" name="menuTeaserSecond">
                    <flux:form.variable name="allowedContentTypes" value="textmedia"/>
                </flux:grid.column>
            </flux:grid.row>
            <flux:grid.row>
                <flux:grid.column colspan="2" colPos="0" name="main" />
            </flux:grid.row>
        </flux:grid>
    </flux:form>
</f:section>

<f:section name="Main">
    <f:render partial="Page" arguments="{_all}" />
</f:section>

Did I do something wrong?

I'm very grateful for your help. Thanks in advance!

Kind regards Sebastian

sebastianschrama avatar Jun 21 '19 19:06 sebastianschrama

It looks like Flux doesn't like the value of colPos. Try <=99 $this->registerArgument('colPos', 'integer', 'Column number - between 0 and 99, should be unique.', true);

ikonplant avatar Jul 01 '19 19:07 ikonplant

Thanks for the hint! Unfortunately a smaller colPos doesn't work either.

sebastianschrama avatar Jul 01 '19 20:07 sebastianschrama

I've just tested this again:. TYPO3 9.5.7, Flux 9.2.0

  1. Very new page layout with your settings => I can confirm the issue, all CEs are allowed;
  2. Change colPos within first row: 1337 => 99
  3. Clear all caches
  4. Reload Page in BE => only textmedia is allowed within colPos 99

Either you didn't clear the caches or there is different behaviour of Flux 9.2.0 with TYPO 3 8.7.26 & TYPO3 9.5.7

My version of fluidpages is likely 4.3.0, which also may play a role

ikonplant avatar Jul 01 '19 21:07 ikonplant

I cleared every possible cache. ;-) All CEs are still allowed. I also tried the older version 4.3.0. Same result. :/

sebastianschrama avatar Jul 02 '19 09:07 sebastianschrama

'Fluidcontent' is not longer supported since some time. how are the content-elements are stored in the database? do they use the field tx_fed_fcefile (fluidcontent) with values like yourext:TwoColumns.html or do they use the field CType with values like: yourext_twowolumns?

If the CType field is used you can use something like:

<flux:grid.column colPos="13" name="headerText" label="LLL:EXT:yourext/Resources/Private/Language/locallang.xlf:flux.ControlPage.columns.headerText">
<flux:form.variable name="allowedContentTypes" value="yourext_infotext" />					
</flux:grid.column>

MediKathi avatar Jul 05 '19 11:07 MediKathi

I don't use the fluidcontent extension. And I already tested your example. It's not working.

sebastianschrama avatar Jul 05 '19 14:07 sebastianschrama

In your example code you use <flux:form.variable name="Fluidcontent" value="{allowedContentTypes: 'Ueberdosis.Ueberdosisprovider:Box.html'}"/>

I think since the migration to actual CType-style content elements this syntax is no longer valid.

simare avatar Aug 13 '19 15:08 simare

For me, for some reason it only works with core elements but not with Flux content elements from my provider extension:

<flux:form.variable name="allowedContentTypes" value="myprovider_mycontentelement"/>
<flux:form.variable name="allowedContentTypes" value="textpic"/>

moe2k avatar Oct 14 '19 12:10 moe2k

allowedContentTypes doesn't work for page templates

still in Flux 9.3.2 without fluidpages

blueamerican avatar May 04 '20 16:05 blueamerican

I can confirm that allowedContentTypes for pages...

  • does not work on TYPO3 v8.7.32 with flux 9.5.0 and fluidpages 5.0.0.
  • does work on TYPO3 v10.4.23 with flux 9.5.0 and without fluidpages.

cweiske avatar Jan 27 '22 11:01 cweiske