Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 change Background image with each category?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

avus3
Starting Member

3 Posts

Posted - June 17 2009 :  14:31:56  Show Profile  Reply with Quote
Hi,

I want to change the background image in my store depending on the category it is. ex: shoes=blue, hats=green, shirts=red...

im not that fluent with asp. any help would be great.

avus3
Starting Member

3 Posts

Posted - June 18 2009 :  12:54:53  Show Profile  Reply with Quote
ok I ended up figuring this one out. But I don't think its the best solution.

I have 15+ categories and ended up doing something like this in the shopheaders.asp file:

<%Dim xheader,xURL
xURL = Request.ServerVariables("QUERY_STRING")%>
<% if xURL="id=14&cat=category1" then %>
<!--#include virtual="/cart/shoppage_header1.htm"-->
<% elseif xURL="id=7&cat=category2" then %>
<!--#include virtual="/cart/shoppage_header2.htm"-->
<% elseif xURL="id=6&cat=category3" then %>
<!--#include virtual="/cart/shoppage_header3.htm"-->
...
<% else %>
<!--#include virtual="/cart/shoppage_header.htm"-->
<% end if%>

so i have 15+ copies of the shoppage_header.htm with the change of the BODY ID name for each appropriate category.

any way to make this more simple or efficient?
Go to Top of Page

Steve2507
VP-CART Expert

590 Posts

Posted - June 19 2009 :  10:14:59  Show Profile  Reply with Quote
Add an extra field to the categories table then have the background change depending on this field.

So the field could contain the filename which is then called. If there is no categorie (i.e. content or default page) then you have a standard catchall file.


Steve
Sex toys from a UK sex shop including vibrators and dildos.
Go to Top of Page

seroom
Starting Member

New Zealand
27 Posts

Posted - April 03 2013 :  18:19:08  Show Profile  Reply with Quote
I have done a similar.
The easiest way was to create multiple copies of the main stylesheet each in it''s own folder along with the unique assets. I placed a new stylesheet link in the shoppage-header below the default and sacrificed the keyword field in the shoppage-header. I replaced the directory name of the altered stylesheet with <%shopdynamictitle "keywords"%> and placed the name of the directory holding the stylesheet in the keyword field of the category/product/content.
Now when you click through from one category to the next the colour of the theme will change to suit. Under the meta keyword I put a static entry.

Below you will see that I have two lines of stylesheet. In the second the reference to /mainsite/ is replaced by /<%shopdynamictitle "keywords"%>/ and any changes in style override the previous.

<link rel="stylesheet" type="text/css" media="all" href="images/mainsite/layout.css" />
<link rel="stylesheet" type="text/css" media="all" href="images/<%shopdynamictitle "keywords"%>/layout.css" />
Go to Top of Page

seroomnz
Starting Member

24 Posts

Posted - June 13 2013 :  01:55:25  Show Profile  Reply with Quote
The site is now live and here is how it worked out.
http://www.thewarehousecharacters.co.nz
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00