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

New Main/Root Categories Page Mod needs last bit of help

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-31-2007, 03:12 AM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default New Main/Root Categories Page Mod needs last bit of help

I am so close to posting a new mod for a main/root categories page that uses content from a static page and a dynamic listing of root cats, but i don't know how to show the root cat icon.

Basically i took code out of subcategories.tpl and modified it to list root cats then inserted it into an if statement inside pages.tpl that tests if we are on the root cat static page. See moded pages.tpl below:

Code:
{* $Id: pages.tpl,v 1.3.2.1 2005/01/19 06:42:51 max Exp $ *} {capture name=dialog} {if $page_content ne ''} {if $config.General.parse_smarty_tags eq "Y"} {**Main/Root Categories Page mod. Replace the page id "9" in the next line of code with the corresponding id of the static page you created for your main categories.**} {if ($smarty.get.pageid eq "9")} {$page_content}<br><br> {if $categories} {**The code below is extracted from subcategories.tpl and slightly modified so that all references to "sub cats" are changed to "cats".**} <TABLE border="0" cellspacing="5" width="100%"> {foreach from=$categories item=cat} <TR> {if $tmp and $first_cat ne "Y"} <TD valign="top" rowspan="{count value=$categories print="Y"}"><IMG src="{if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/icon.php?categoryid={$cat}{/if}"></TD> {assign var="first_cat" value="Y"} {/if} <TD align="left" width="95%">&nbsp;<A href="home.php?cat={ $cat.categoryid }"><FONT class="ItemsList">{ $cat.category|escape }</FONT></A><BR></TD> <TD align="right" nowrap><FONT class="Text">{if $config.Appearance.count_products eq "Y"} {if $cat.product_count}{ $cat.product_count } {$lng.lbl_products} {elseif $cat.subcategory_count}{ $cat.subcategory_count } {$lng.lbl_categories|lower} {/if} {/if}</FONT></TD> </TR> {/foreach} </TABLE> {/if} {else} {eval var=$page_content} {/if} {**End Main/Root Categories Page mod.**} {else} {$page_content} {/if} {/if} {/capture} {include file="dialog.tpl" title=$page_data.title content=$smarty.capture.dialog extra="width=100%"}

This line should show the root cat icon but it is still for subcat icon: <TD valign="top" rowspan="{count value=$categories print="Y"}"><IMG src="{if $current_category.icon_url}{$current_category.icon _url}{else}{$xcart_web_dir}/icon.php?categoryid={$cat}{/if}"></TD>

Any ideas?
__________________
Version 4.1.3
Reply With Quote
  #2  
Old 08-13-2007, 08:33 AM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default Re: New Main/Root Categories Page Mod needs last bit of help

Try this:

Code:
<img src="{if $c.icon_url}{$c.icon_url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}">

- Mike
__________________
4.1.9
Reply With Quote
  #3  
Old 08-13-2007, 02:23 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: New Main/Root Categories Page Mod needs last bit of help

are you displaying a categories listing with icons on the main page?

if so, look at http://forum.x-cart.com/showthread.php?t=32237 , I made a similar mod but if I remember correctly, I used welcome.tpl to insert my code to put it at the top and in a seperate section
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #4  
Old 08-13-2007, 03:11 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Thumbs up Re: New Main/Root Categories Page Mod needs last bit of help

Hey you guys, thanks for the help.

The technique I used was to create a static page for my Main/Root category page - so the client could insert copy in it easily. I do that by modifying pages.tpl with an if statement to include categories.tpl - see Beginners Example of Static Page with Dynamic Content.

I tried modifying categories.tpl to show icons (from within pages) but to no avail. I think i already tried mffowler's example code earlier and it didn't seem to work. Eventually I gave up and the client is happy not having the icons so if we figure this out now - I guess it would be to complete a mod for x-cart users' sake.
__________________
Version 4.1.3
Reply With Quote
  #5  
Old 08-13-2007, 05:10 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: New Main/Root Categories Page Mod needs last bit of help

you may want to look at http://forum.x-cart.com/showthread.php?t=32195 ? it uses positioning rather than id number
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
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 05:07 AM.

   

 
X-Cart forums © 2001-2020