X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Replacing Menu headings with Gifs? (https://forum.x-cart.com/showthread.php?t=21977)

Grant 05-22-2006 06:08 AM

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 ?

balinor 05-22-2006 06:14 AM

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]

Grant 05-22-2006 08:46 AM

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}

balinor 05-22-2006 09:59 AM

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>

Grant 05-22-2006 11:50 AM

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}

balinor 05-22-2006 01:00 PM

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>


Grant 05-22-2006 01:16 PM

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.

Grant 05-23-2006 04:03 AM

Anybody know how I can get this cell formatting back?

balinor 05-23-2006 04:06 AM

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.

Grant 05-23-2006 04:45 AM

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


All times are GMT -8. The time now is 01:19 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.