4 Replies Latest reply on Nov 11, 2008 4:46 AM by Max Rydahl Andersen

    Visual Editor: Problem with stylesheet path and multiple vie

    Asgeir Frimannsson Newbie

      Hi folks,

      I have a Seam-gen project with the following structure:

      view/stylesheet/theme.css
      view/layout/template.xhtml
      
      view/home.xhtml (uses template.xhtml)
      view/admin/home.xhtml (uses template.xhtml)


      The template references the stylesheet as follows:

      <link rel="stylesheet" type="text/css" href="#{request.contextPath}/stylesheet/theme.css"/>


      This works well at runtime, but not within the Visual Editor, which doesn't pick up the stylesheet. Giving the href a relative location like './stylesheet/theme.css' works well for views within the root 'view' folder, but not for views within sub-folders.

      My current workaround is to add the relative path to the stylesheet within the template.

      <!-- This href enables pages in first-level sub-folders to access the css -->
      <link rel="stylesheet" type="text/css" href="../stylesheet/theme.css"/>
      
      <!-- This href enables root folders to access the css -->
      <link rel="stylesheet" type="text/css" href="./stylesheet/theme.css"/>


      My question is: Is there any way to avoid such a 'hack' to enable the visual editor to view styled pages within sub-folders. Is there any way to e.g. specify the absolute location of the stylesheet/template?