Search code examples
typo3fluxfluid

How do I fetch the UID of a page that's been selected with flux:wizard.link?


I'm using the flux:wizard.link to select a page from the page tree in Typo3:

<flux:field.input name="page_id" label="Select page">
    <flux:wizard.link activeTab="page"/>
</flux:field.input>

Now, I want to fetch this page and render it in a container.

<v:content.render pageUid="{page_id}" />

But the {page_id} has the t3-link saved instead of the expected pageUID (e.g. t3://page?uid=125) How do I extract the page's UID?

I could let the user enter just the page-id in an input-field, but I'd rather have her select the page via wizard...


Solution

  • One solution could be to cut the string into two parts:

    <v:iterator.explode content="{page_id}" glue="uid=" as="newarray">
      {newarray.1}
    </v:iterator.explode>
    

    The string page_id is cut at the phrase 'uid=' into two parts, which are saved in the array newarray. With {newarray.1} you can output the second part of the array.

    This is most likely not the best solution. It depends on the link which should have always the same structure (containing 'uid=xxx'). But so far it seems to be the only way.