Aller au contenu principal

Rules: validate uid of pagetemplate

Commentaires

3 commentaires

  • Zendesk API User
    Author: hoebbel - 5/12/2023 14:08

    Hi sharzmeier,

    you could try this:

    Define a (hidden) text component within the (all) pagetemplates, which saves the template UID, e.g.

    <CMS_INPUT_TEXT name="pt_templateuid" hidden="no"> <LANGINFOS> <LANGINFO lang="*" label="templateuid"/> </LANGINFOS> </CMS_INPUT_TEXT> <RULE when="ONLOCK"> <WITH> <PROPERTY name="TEMPLATE" source="#global"/> </WITH> <DO> <PROPERTY name="VALUE" source="test"/> </DO> </RULE>

    Now you can use the FormDataValueService to copy this information to an appropriate (hidden) component within the section template

    <CMS_INPUT_TEXT name="st_pagetemplate_uid" hidden="no"> <LANGINFOS> <LANGINFO lang="*" label="pagetemplate uid"/> </LANGINFOS> </CMS_INPUT_TEXT> <RULE> <SCHEDULE delay="0" id="pagetemplate" service="FormDataValueService"> <PARAM name="UID"> <PROPERTY name="PAGE_UID" source="#global"/> </PARAM> <PARAM name="UIDTYPE"> <TEXT>PAGESTORE</TEXT> </PARAM> <PARAM name="FIELD"> <TEXT>pt_templateuid</TEXT> </PARAM> <PARAM name="LANGUAGE"> <TEXT>DE</TEXT> </PARAM> </SCHEDULE> <DO> <PROPERTY name="VALUE" source="st_pagetemplate_uid"/> </DO> </RULE>

    Now you can use the content of this component within your rule

    Best regards
    Holger

    Hint: This will only work for changed pages. The formDataValueService reads the stored information. So the page has to be saved once with the pagetemplate information - afterwards it will be available within the section template

    0
  • Zendesk API User
    Author: sharzmeier - 5/15/2023 15:31

    tricky, but it works

    0
  • Zendesk API User
    Author: matthiasforberg - 10/18/2024 10:50

    Thanks! Very helpful!

    (follow up question here in German language)

    0

Vous devez vous connecter pour laisser un commentaire.