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

Replacing Menu headings with Gifs?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-22-2006, 06:08 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default Replacing Menu headings with Gifs?

I've been having a look around but can't seem to find a simple solution - although i'm sure there is one...

How would I go about using gif images for the 'Catergories', 'Account', 'Bestsellers', 'Special' & 'Help' headings ?
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #2  
Old 05-22-2006, 06:14 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Hard code them into the menus themselves. For categories as an example, edit categories.tpl, remove these lines:

{capture name=menu}

{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

and then just hard-code the image:

[img]{$ImagesDir}/imagename.gif[/img]
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-22-2006, 08:46 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Right, have done that in categories.tpl and it works lovely but there is one problem.. I've lost the Class formatting for the text :

http://www.wyzeshop.com/screenshot6.jpg

What code do I need to add and more importantly where do I put it?

This was my original (modded) categories.tpl

Quote:
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{$categories[cat_num].category}

{else}
{$categories[cat_num].category}<HR size="1" noshade class="CateMenuHr">
{/if}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{section name=subcat loop=$allcategories}
{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if}

{/if}
{/section}
<HR size="1" noshade class="CateMenuHr">
{/if}
{/section}
{else}
{section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

And this is the new one with the capture tags removed :

Quote:
[img]{$ImagesDir}/catheading.jpg[/img]
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{$categories[cat_num].category}

{else}
{$categories[cat_num].category}<HR size="1" noshade class="CateMenuHr">
{/if}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{section name=subcat loop=$allcategories}
{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if}

{/if}
{/section}
<HR size="1" noshade class="CateMenuHr">
{/if}
{/section}
{else}
{section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #4  
Old 05-22-2006, 09:59 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

That's because menu.tpl was calling the VertMenuBox class. You can add it back in by surrounding your code with a <div> tag like this:

<div class="VertMenuBox">

code

</div>
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 05-22-2006, 11:50 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Oh god am I just being a donut?

I can't get this working..

I've tried putting them in all sorts of places but nothing seems to work.
I've put them at the very start and end of the code, at varying different points around text items etc

I'm lost

Could you show me where to insert them on the .tpl below please?

Quote:
[img]{$ImagesDir}/catheading.jpg[/img]
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{$categories[cat_num].category}

{else}
{$categories[cat_num].category}<HR size="1" noshade class="CateMenuHr">
{/if}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{section name=subcat loop=$allcategories}
{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if}

{/if}
{/section}
<HR size="1" noshade class="CateMenuHr">
{/if}
{/section}
{else}
{section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #6  
Old 05-22-2006, 01:00 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Try this:

Code:
[img]{$ImagesDir}/catheading.jpg[/img] <div class="VertMenuBox"> {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category}<HR size="1" noshade class="CateMenuHr"> {/if} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if} {/if} {/section} <HR size="1" noshade class="CateMenuHr"> {/if} {/section} {else} {section name=cat_num loop=$subcategories} <FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT> {/section} {/if} {/if} </div>
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 05-22-2006, 01:16 PM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Nope

That was the first thing I tried. I also copied and pasted the above with your ammendments just in case I missed something and still no love?

This was the thing that caused me to start this thread in the first place. I couldn't work out how to bring that VERTMENU code back into the template after killing off the captures.
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #8  
Old 05-23-2006, 04:03 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Anybody know how I can get this cell formatting back?
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #9  
Old 05-23-2006, 04:06 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Sorry, forgot about this thread. Ok, add the menu wrapper back in (keep your custom image inside the {capture} tag, but change it to menu2.tpl. Create a new template called menu2.tpl, and insert this code in to it:

Code:
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%"> <TR> <TD class="VertMenuBorder"> <TABLE border="0" cellpadding="1" cellspacing="1" width="100%"> <TR> <TD class="VertMenuBox"> <TABLE border="0" cellpadding="5" cellspacing="0" width="100%"> <TR> <TD>{$menu_content} </TD></TR> </TABLE> </TD></TR> </TABLE> </TD></TR> </TABLE>

See if that does the trick.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #10  
Old 05-23-2006, 04:45 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Nope tried it with both :

{capture name=menu2.tpl} & {capture name=menu2}

Both bring up an empty categories menu & I've lost the category jpg
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 09:28 AM.

   

 
X-Cart forums © 2001-2020