Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-8258

Document alternative way of displaying Page Templates

    Details

    • Type of Documentation:
      Developer

      Description

      This was reported on our Slack channel by Evan Thibodeau.

      Verbatim from the [Slack post|https://liferay.slack.com/archives/CKZUJ01PB/p1598244623014500?thread_ts=1598244619.014400&cid=CKZUJ01PB]:

      Hey team! I stumbled across a really cool feature for display page templates that I don't think is documented. I thought I'd post it here in case you all want to add it in.
      On display page templates you can access the currentEntry for that display page using the following freemarker snippet in a page fragment that will be placed on a display page:

      {{assign currentEntry = (request.getAttribute("LIFERAY_SHARED_LAYOUT_ASSET_ENTRY"))! / }}

      @Ben Turner and I have used this on the sales library to render tags and categories on a display pages for documents and web-content articles. I first learned about this feature through a blog post that @Jan Verweij shared by one of our partners: https://blog.finalist.nl/en/blog/using-liferay-fragments-modular-webcontent-templates/ This article highlights some other use cases and the ultimate power it provides devs.

      https://blog.finalist.nl/en/blog/using-liferay-fragments-modular-webcontent-templates/

       

        Attachments

          Activity

            People

            Assignee:
            jorge.perez Jorge Pérez Campo
            Reporter:
            jorge.perez Jorge Pérez Campo
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support

                  Packages

                  Version Package
                  7.3.x