Search code examples
typo3fluidtypo3-6.2.x

Check if pid of current page is X


How can I check if a page has a specific ID, and if true output a text?

I thought about something like this (pseudocode):

<f:if condition="{current.page.uid}=='78'">
    <p>I am Page 78</p>
</f:if>

Solution

  • If you want to use this in an FLUIDTEMPLATE (page.10 = FLUIDTEMPLATE as example) you can access the page data with {data.uid}.

    <f:if condition="{data.uid} == 78">
      <p>I am Page 78</p>
    </f:if>
    

    In an extbase Extension you can make it like @dimitri-l says.