Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCU-1040

Fallbacking of ${content.windowTitle!content.title!} in i18n-ized content

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Neutral
    • None
    • None
    • None

    Description

      The mgnl CLI (2.1.0) command

      mgnl create-page hello
      

      will produce a FreeMarker file where the <title> element for the page is generated in the following way:

      <title>${content.windowTitle!content.title!}</title>
      

      From the author perspective, the command should default to the content of title if nothing is found for windowTitle.

      In an i18n-ized project, however, this may be rather tricky: The resolver may actually provide a fallback windowTitle value from the JCR instead of the FreeMarker default title, even though the content for the title does exist for the given language version of the page.

      Thus, under the following definition of page properties,

      The English variant:

      • title:
      • windowTitle: This is the homepage

      The German variant:

      • title: "Dies ist die Homepage."
      • windowTitle:

      the <title> element in the German version will be rendered with the English "This is the homepage".

      This could be documented somewhere (i18n / mgnl-cli).

      Q for the DEVs: Could this behavior be fixed by making windowTitle a child of title in the class and, consequently, modifying also the print command to fallback to the parent?

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                mdrapela Martin DrĂ¡pela
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoR