3 Replies Latest reply on May 17, 2007 11:18 AM by ajohnson1200

    Image paths in custom-css.ftl

      I'm creating a clearspace theme with a custom template for

       

      /template/global/custom-css.ftl

       

      It looks like my custom css is being included as inline css on the page itself.  So, since each page can be at a difference context, how would i reference relative image paths in my css?  I'd like all pages to use images from clearspace's /images directory.

       

      Thanks for any help!

        • Re: Image paths in custom-css.ftl

          I was browsing other templates and found a solution.

           

          <@ww.url value="/images/custom/my-image.gif"/>

           

          That appends the application root to a static path.  I'd still prefer using relative image paths from within a css file, but if my custom css has to be inline, looks like this generated static path will work.

            • Re: Image paths in custom-css.ftl

              There's some danger to this approach, as you'll loose this customization when/if you upgrade Clearspace. A better path to use is one that starts with "/themes". That will point you into your jiveHome directory that doesn't get messed with during an upgrade. And if you really want to be relative, create your own css file and put it in the /themes path somewhere.

                • Re: Image paths in custom-css.ftl

                  Just to clarify Doug's point, the danger in your approach is specifically with the image path you're using (the @ww tag syntax is perfect for what you're talking about and using the custom-css.ftl is great as well).  Like Doug mentioned, what you'll probably want to do is add your images into jiveHome: keeping them out of the webapp makes upgrades way easier and less painful.

                   

                  Cheers,

                   

                  AJ