Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-149569

As a content editor, I'd like to map data into data-* or value attribute of an HTML tag for Fragment and Collection Display.

    Details

      Description

      User Story
      Our company is an insurance company, and all agent carries a tablet to access the agent portal built on top of Liferay. On the agent portal, the agent shows menus to customers, access internal data, and communicate with other members.

      Our company uses a tracking system similar to Google Analytics, and all links on the agent portal are associated with a unique tracking ID.

      As a content editor of the agent portal, I'm using Web content (Web Content Structure) to store a URL, a title of the link, a link image, and the tracking id. Then with a Collection Display, I assign a fragment and map the fields to fragment lfr-* fields.

      We wanted to store the tracking id in a data-* attribute of an HTML tag by mapping on a fragment, say a tag, then picking it up by Javascript to send the data to the Analysis system before redirecting to the link.

      However, lfr-editable fields are not designed for mapping attributes. It only allows you to map data between start and end tags.

      We ended up calling services to access an asset and pulling out the data and applying it with Freemarker, but it'd be handy if it's possible with Fragment mapping.

      The sample of workaround is this gist.

        Attachments

          Activity

            People

            Assignee:
            mateo.hermosin Mateo Hermosin
            Reporter:
            yasuyuki.takeo Yasuyuki Takeo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package