Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

dialog.tpl background image

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-19-2008, 03:56 AM
 
amcc amcc is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 73
 

Default dialog.tpl background image

I want to put some background images on my static pages, ie. in dialog.tpl.

What's the best way to go about this?

Will I need to create new dialog.tpl for each static page in order to apply a different image? Maybe there's a css answer to avoid this?
__________________
X-Cart Pro 4.1.8
Reply With Quote
  #2  
Old 04-19-2008, 01:44 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: dialog.tpl background image

One easy way is to use something similar to what skin1/customer/home_main.tpl does and differentiate the areas by seeing what $main contains. The only problem with this method is that you'll have to add a new class appending the pageid to it everytime in the css (or inline styles if you prefer)...

For instance open up skin1/dialog.tpl and locate the second DialogBox within the TD...
Code:
class="DialogBox"
and change to... (adding {if $main eq "pages"}{$page_data.pageid}{/if} immediately after the class name so there are no spaces)
Code:
class="DialogBox{if $main eq "pages"}{$page_data.pageid}{/if}"

Then open up skin1/skin1.css and add the new class like so (I've used the xcart logo for an example so make sure you reference the correct image) the only thing to watch out for is adding your own images for each individual page id. So if you have a static page with a pageid of 12, append 12 to a new copy of TD.DialogBox like so...
Code:
TD.DialogBox12 { BACKGROUND-COLOR: #FFF; TEXT-ALIGN: left; PADDING: 10px; BACKGROUND-IMAGE: url(images/xlogo.gif); }

And hopefully, when you visit a static page, they will have a background image whilst the other pages will not.

Hope this helps.

===========================
EDIT: Forgot to mention a few bit & bobs
__________________
Doms
kube v4.1.9
Reply With Quote
  #3  
Old 04-19-2008, 02:22 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: dialog.tpl background image

Another way so there is always an image for a static page by default (for instance, for a new page with no new background image set yet) would be to change the TD with DialogBox again to (making sure there are no spaces again, except for between Page and PageID - creating 2 class elements within one call)...

Code:
class="DialogBox{if $main eq "pages"}Page PageID{$page_data.pageid}{/if}"
then add two more classes to skin1.css like so. A default one with the same image...
Code:
TD.DialogBoxPage { BACKGROUND-COLOR: #FFF; TEXT-ALIGN: left; PADDING: 10px; BACKGROUND-IMAGE: url(images/xlogo.gif); }
and then a second class which only references the image per pageid (remembering to append the correct pageid in this example again set at 12)
Code:
TD.PageID12 { BACKGROUND-IMAGE: url(images/dingbats_categorie.gif); }

So this way, for example, if you were to go and visit a static page with a pageid of 4 (a pageid which hasn't got a custom bg image yet) then the xcart logo will appear as the background image. If you were to go to a page with pageid 12 then the dingbats would appear instead.

Hope this helps.
__________________
Doms
kube v4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:07 AM.

   

 
X-Cart forums © 2001-2020