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

Problems when running preview of fragments from CLI with custom theme

    Details

      Description

      If I run "npm run preview" to have a preview of fragments that I am preparing with my own editor, I get a problem when the site that I want to use for testing has a custom theme. Usually custom themes make use of variables like "full_templates_path", "images_folder", etc inherited from the styled or unstyled themes that the theme is extended, but those variables seems to create a problem when invoked through the "npm run preview" command

      Steps to reproduce
      1. Follow this article to start fragment development in CLI
      2. Create a new fragment (whatever html/css code, just a simple test)
      3. run "npm run preview"
      4. Answer all questions properly depending on your local Liferay installation (URL, user, password, instance, groupid)

      Expected result
      A message with Preview URL "http://localhost:8181" appears so you can open a browser and see the preview --> see attachment IMAGE CORRECT 1.png

      Actual result
      A message about wrong compatibility is thrown --> see attachment IMAGE ERROR 1.png
      An exception is thrown in the Liferay's log:

      FTL stack trace ("~" means nesting-related):

      • Failed at: ${preferences} [in template "classic-theme_SERVLET_CONTEXT_/templates/navigation.ftl" at line 7, column 64]
      • Reached through: @liferay.navigation_menu default_pref... [in template "classic-theme_SERVLET_CONTEXT_/templates/navigation.ftl" at line 7, column 17]
      • Reached through: #include "${full_templates_path}/navi... [in template "toyota-theme_SERVLET_CONTEXT_/templates/portal_normal.ftl" at line 30, column 25]

      NOTE: in my case I can delete ${full_templates_path} variable, and then everything works as expected; however I still believe this is a bug because there are other variables that are inherited that could be used (and are extensively used usually in custom themes)

        Attachments

          Activity

            People

            • Assignee:
              yang.cao Yang Cao
              Reporter:
              rafael.lluis Rafael Lluis
              Participants of an Issue:
              Recent user:
              Yang Cao
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 2 weeks, 6 days ago

                Packages

                Version Package
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                Master