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

Creating a Main/Root Categories Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-13-2006, 03:38 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default Creating a Main/Root Categories Page

I'd like to create a main/root categories page that would have a description and list the main cats. Much like how an individual category page does.

It sure seems like someone would have had the need to do this in the past, however after extensive forum searching i could find no reference to it.

I created a relatively simple mod that works by using a static page field for the description of the page and a mod in pages.tpl that borrows code found in "subcategories.tpl" (i switched subcats with $category elements)

Is there a more elegant way to do this? Any ideas on how to adjust location.tpl to include my static page before the categories and product?

Many thanks!
__________________
Version 4.1.3
Reply With Quote
  #2  
Old 08-13-2006, 06:43 PM
 
mffowler mffowler is offline
 

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

Default

The category can't be called into the home page as it isn't in the products array. You could easily "add products" to the home page using a modified "Featured Products" tpl or just a static page placed in the welcome.tpl (skin1/customer/main).

I do wish that categories could be called into the home page next to featured products as that would allow a much nicer entrance for customers to get to comarative products.

- Mike
__________________
4.1.9
Reply With Quote
  #3  
Old 08-13-2006, 09:03 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default

Thanks for responding... not exactly sure what you mean by calling categories from the Home page - cause if it means listing categories then that can be done from Home - never tried it from the Welcome.

My need specifically is to have another page "after" the home page that lists the root categories and text - sort of a master categories page that also shows up directly after the home page in the breadcrumbs (location.tpl).

Ya know what i mean?
__________________
Version 4.1.3
Reply With Quote
  #4  
Old 08-14-2006, 05:54 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default My solution

Well I managed to come up with a fairly elegant solution.

I went with a static page so that my client could modify the static element of the page. I then placed an if statement in skin1/customer/main/"pages.tpl" to test if we're on the page (pageid=9 in my case) and then handle the dynamic listing of main categories. The code to do the dynamic listing was borrowed from skin1/customer/main/"subcategories.tpl". Here is that code that i modified and inserted into pages.tpl:

Code:
{** AC_Mod for root catalog page **} {if ($smarty.get.pageid eq "9")} <span class="bigred">Pharmacopia Catalog</span> [img]{$ImagesDir}/aaCustomInterface/a_Spacer.GIF[/img] {$page_content} [img]{$ImagesDir}/aaCustomInterface/a_Spacer.GIF[/img] {capture name=dialog} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} <TABLE border="0" cellspacing="5" width="100%"> {section name=cat_num loop=$categories} {if $categories[cat_num].category ne "Medical Conditions"} <TR> <TD align="left" width="95%"><FONT class="ItemsList">{$categories[cat_num].category}</FONT> </TD> <TD align="right" nowrap><FONT class="Text"> {if $config.Appearance.count_products eq "Y"} {if $categories[cat_num].product_count}{ $categories[cat_num].product_count} {$lng.lbl_products} {elseif $categories[cat_num].subcategory_count}{ $categories[cat_num].subcategory_count } {$lng.lbl_categories|lower} {/if} {/if}</FONT></TD> </TR> {/if} {/section} </TABLE> {/if} {/if} {/capture} {include file="dialog.tpl" title="Main Categories" content=$smarty.capture.dialog extra="width=100%"} In this paragraph we can briefly introduce the Phytomedicinal column to the right and describe how to use it. We can also tell them about the search and the advanced search. {/if}

The modification of the pasted subcategory code involved taking out the column that shows cat/product thumbnails (you could leave that in), an if statement to not list a cat entitled "Medical Conditions", and MOST importantly substituting all references for sub cats to cats. That was the key that you should do and made it work like a charm.

Fixing the breadcrumbs (location.tpl) to start with my main category page was easy - just refer to this post: http://forum.x-cart.com/viewtopic.php?t=24008&highlight=main+catalog+catal ogue

To view the final root categories page on my site go to:
http://amazonmedicine.com/xcart/pages.php?pageid=9

I hope this helps someone
__________________
Version 4.1.3
Reply With Quote
  #5  
Old 09-10-2006, 03:07 PM
  shipmerchant's Avatar 
shipmerchant shipmerchant is offline
 

eXpert
  
Join Date: Mar 2005
Posts: 361
 

Smile Re: My solution

Hi Hunabku,

Thank you very much for sharing your mod with us. You should add it to the completed mod section, if its not there already. I like the way you have the portol setup to take the customer to the html pages you created. I also noticed what we already should expect from search engines spiders and their appetite for html pages as opposed to php. Your HTML pages seems to rank much higher then the dynamic pages.

This is nice, especially since your link html pages dont follow the general layout design of your main site. This must come in handy when you need to modify things on your main site, so when you do, you wont have to add or modify categories to your html pages. I think the only thing I would be concerned with is making sure you update your link from the html pages, back to your php pages and visa versa.

Thanks again for sharing, I will have to experiment with it.
__________________
Mil Mascaras
Live Xcart Site #1-V- 4.1.8
Live Xcart site # 2-V 4.4.3
CDSEO Mod - Firetank MM30 - 7DANA- The bestTemplates!
Linux - EWD Host Servers awesome service!
AlteredCart One Page Checkout
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 06:03 AM.

   

 
X-Cart forums © 2001-2020