Question

I'm trying to add a section into my fluidpage extension.

<f:section name="Configuration">
    <flux:flexform id="default" label="Gallery Page" icon="{f:uri.resource(path: 'Icons/DefaultPage.png')}">
        <flux:flexform.section name="images">
            <flux:flexform.field.file name="ls" label="Landscape image" maxItems="1" minItems="1" required="1" showThumbnails="1" />
            <flux:flexform.field.select name="lsAlign" label="Alignment of the landscape image" items="left,right" />
            <flux:flexform.field.file name="pt" label="Portrait image" maxItems="1" minItems="1" required="1" showThumbnails="1" />
            <flux:flexform.field.select name="ptAlign" label="Alignment of the portrait image" items="left,right" />
        </flux:flexform.section>

        <flux:flexform.grid>
            <flux:flexform.grid.row>
                <flux:flexform.grid.column colPos="0" name="Main Content" />
            </flux:flexform.grid.row>

            <flux:flexform.grid.row>
                <flux:flexform.grid.column colPos="1" name="Gallery Images" />
            </flux:flexform.grid.row>
        </flux:flexform.grid>
    </flux:flexform>
</f:section>

If I try this, the backend stays empty if I try top open page properties. As soon as I remove the section everything is fine. Also tried to put a felexform.object around the fields inside the section

<flux:flexform.section name="images" label="images">
            <flux:flexform.object name="imageObject" label="image object">
                <flux:flexform.field.file name="ls" label="Landscape image" maxItems="1" minItems="0" required="0"
                                          showThumbnails="1"/>
                <flux:flexform.field.select name="lsAlign" label="Alignment of the landscape image"
                                            items="left,right"/>
                <flux:flexform.field.file name="pt" label="Portrait image" maxItems="1" minItems="0" required="0"
                                          showThumbnails="1"/>
                <flux:flexform.field.select name="ptAlign" label="Alignment of the portrait image"
                                            items="left,right"/>
            </flux:flexform.object>
        </flux:flexform.section>

also no luck this was.

Markus

Was it helpful?

Solution

If you are currently previewing TYPO3 6.2 (current master branch, still unreleased at the time of writing this) then you may very well be experiencing this bug: http://forge.typo3.org/issues/56405

If you are on TYPO3 6.1 then this feature should work and you should not be affected by the bug in the above link. I will assume in the rest of this response that you use 6.1 or that the bug in question is somehow fixed in your local repository, for example by reviewing the merge request linked to on that URL.

You are a little unclear on which "section" you remove to restore the backend - if it is the f:section named Configuration you are removing, this will cause fluidpages to ignore the template. If it is the flux:flexform.section you are removing to get it working, there could be a few reasons for it failing:

  • Using file references inside Objects in Flux forms (NB: the Object is required, you cannot place fields directly inside a Flux Section) can have adverse effects on systems with FAL. The TCA used by FAL is easily manipulated into being incompatible with flexform fields (Flux fields still appear like flexform fields to TYPO3) which can cause errors to happen.
  • Using Section and Object in a fluidpages template has one limitation: the objects you store cannot be inherited to subpages due to the way default values are currently being handled by TYPO3. It is possible future versions of Flux may in some way solve this, but currently is is a limitation you have to work around.

If you are affected to any of the first possible problems, errors will have been reported and placed either in your devlog (see the devlog extension), in your syslog (as configured in the TYPO3 install tool) or in your PHP error log (as configured by your web server or PHP settings). If you are unsure how to inspect these logs you may be able to read the same message by enabling "debug mode" in Flux's extension configuration (inside Extension Manager). Setting this value to "2" should ensure you only see errors, not general feedback messages. The error message may help you solve the problem - or you are welcome to add it to this question and I will take it into consideration in an edit.

Finally, if you are expecting this Section and Object to be inherited to subpages you will be facing a blocker - this is simply not possible currently. The Object should be usable on the same page it is defined, but cannot be accessed on subpages (at least not without workarounds for example using Flux's data getting ViewHelper and manual page UID resolving).

If you are blocked in this way, I suggest instead:

  • Create a sysfolder or reuse your general storage sysfolder
  • Insert a content element into this sysfolder and make that content element an FCE which contains the Object you desire.
  • Using your page template's configuration fields, reference this content element (for example a relation type to tt_content or an input field with a browse wizard).
  • In your page template's output, manually render this specific content element by UID using v:content.render and argument contentElementUids="{0: myFieldName}" where myFieldName is the name of your page configuration field. Note that the UID list is an array!

Alternative:

  • Add a special page content column
  • Configure this column's rendering with slide set on v:content.render - for example with a value of -3 to slide the top page's special content column to the first three levels of subpages.

Hope this helps Markus - if not, feel free to add more precise information about your desired implementation.

OTHER TIPS

The section must contain a object which contains the fields:

<flux:flexform.section name="images" label="images">
    <flux:flexform.object name="foo2" label="foo2">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top