Adding Images to my own template

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Adding Images to my own template

Post by Wishbone »

If you are referring to images in your CSS, make sure you do something like:

Code: Select all

body {
  background-image: url([[root_url]]/uploads/images/body.png);
}
Note that the images are relative to your tmp/cache directory, and not the document root.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Adding Images to my own template

Post by velden »

For style sheets:

Code: Select all

body {
  background-image: url([[root_url]]/uploads/images/body.png);
}

OR 

body {
  background-image: url([[uploads_url]]/images/body.png);
}

within template

Code: Select all

<img src="{uploads_url}/images/example.jpg" class="whatever" alt="what you like" width="100" height="20" />

etc.etc.
I personally like to create an 'uploads/template/images' folder to make a distinction between 'user/content' images and 'template' images.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Adding Images to my own template

Post by Wishbone »

velden wrote:I personally like to create an 'uploads/template/images' folder to make a distinction between 'user/content' images and 'template' images.
I do something similar... uploads/images/site for template images.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Adding Images to my own template

Post by Dr.CSS »

I use the /uploads/themefolder scheme also, I don't put them anywhere in the /uploads/images as anyone editing pages can choose from there, I also put all my JS files in uploads/js...
Post Reply

Return to “Layout and Design (CSS & HTML)”