[opencms-dev] Best location for resources like images and css

RuiXian BAO ruixian.bao at gmail.com
Mon Feb 25 23:48:43 CET 2008


Hello Yves,

On Mon, Feb 25, 2008 at 11:49 AM, Yves Glodt <yg at mind.lu> wrote:

> Hello,
>
> I successfully created a template, and I put css and images to the
> resources/css and resources/images subfolders.
>
> This works well, but what bothers me is that when I want to link to an
> image,
> (which Editors will also have to do soon), they have to browse through
> the /system folder deep into my template to find the image. I do not want
> that editors can even enter into /system.
>

Editors usually don't directly deal with css files. For images, you can
change the image folder to the type of Image gallery, then edtiors can
access  them when editing.


> Also, when I link to the css files from my template, currently I do like
> this:
> <link href='<cms:link>../../resources</cms:link>/css/main.css'
> rel='stylesheet' type='text/css' />
>
> This feels strange for me... :-)
>

You can use the absolute path starting with "/system", then OpenCms will
correctly parse them by the aid of <cms:link>..</cms:link> tag.


> What speaks agains putting the images and css (or at least the images,
> which
> editors might need to upload or work with) into
> the /sites/default/mysite.com/images folder?
>

Not in a convention way, at least.

Best

- RuiXian


> Then I could just do:
> <link href='/css/main.css' rel='stylesheet' type='text/css' />
>
> Of course it would break the separation between content and template.
> Could a sibling be a used for that?
>
> Best regards,
> Yves
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080226/0cf003b8/attachment.htm>


More information about the opencms-dev mailing list