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

Changing links from category to static pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-27-2009, 08:57 AM
 
rageon75 rageon75 is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 108
 

Default Changing links from category to static pages

Hello everybody.

I am starting to create a new website for a bicycle company www.chimera-bikes.com. I decided to use one of the new skins from X-Cart: "Artistic Tunes - Car Tires" as a starting point. They wanted to have two menus. A horizontal menu on the top with static pages and another menu on the left with products and categories.

So, I added the left menu with categories but the Horizontal menu is still displaying the category links.

How do I change it so I can link the static pages to the horizontal menu?

This is what I have changed so far in the head.tpl:

------------------------------------------------------------------

{if $categories_menu_list}

<div class="top-categories">

<div class="hor-categories">
<ul id="hr_list">
{foreach from=$categories_menu_list item=c}
<li><a href="http://www.chimera-bikes.com/age_guide.html" title="Age Guide">{$c.category}</a></li>
<li><a href="http://www.chimera-bikes.com/size_guide.html" title="Size Guide">{$c.category}</a></li>
<li><a href="http://www.chimera-bikes.com/style_guide.html" title="Style Guide">{$c.category}</a></li>

{/foreach}
</ul>
</div>

<div class="more-categories" onmouseover="javascript: hrMenuShow('cat_list');" onmouseout="javascript: hrMenuHide('cat_list');">
<a href="javascript:void(0);"><img id="menu_more" src="{$ImagesDir}/custom/menu_more.gif" alt="" /></a>
<ul id="hr_menu" style="display: none;" ><li>&nbsp;</li></ul>
</div>

</div>

{/if}
----------------------------------------------------------------------

When I made the new changes it generated the links three times? I am still trying to learn the basics of php so any help would be appreciated.

Thanking everybody for their time and knowledge.
__________________
X-Cart Gold 4.2 - 4.3 - 4.4.5 - 4.6 - 4.7
Reply With Quote
  #2  
Old 03-27-2009, 05:20 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing links from category to static pages

The templates use smarty - not php - so you might want to also checkout this site on smarty when you want to figure out the code in the tpl files.

It looks like you added your links inside a smarty foreach loop that iterates through the categories - which would explain why they repeat.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #3  
Old 03-30-2009, 09:22 AM
 
rageon75 rageon75 is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 108
 

Default Re: Changing links from category to static pages

Thank you gb2world for your response. I am checking out the website that you recommended. It looks like I am going to be spending a lot of time there.

So how would I make the links not repeat?

Thanking you again for your help.
__________________
X-Cart Gold 4.2 - 4.3 - 4.4.5 - 4.6 - 4.7
Reply With Quote
  #4  
Old 03-30-2009, 10:48 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing links from category to static pages

Hi rageon75 -

Sorry - I'm not clear on what you are trying to do - that is - I don't know what static link you want with what category - or, maybe you don't want the categories at all?

The foreach loop is cycling through your categories - so it is going to repeat what you put in between the foreach and /foreach for every category. If you do not want the categories - you don't need any of the smarty.

I don't use 4.2 so - I'm not familiar with the classes, but maybe what you want is:

Code:
<div class="hor-categories"> <ul id="hr_list"> <li><a href="http://www.chimera-bikes.com/age_guide.html" title="Age Guide">Age Guide</a></li> <li><a href="http://www.chimera-bikes.com/size_guide.html" title="Size Guide">Size Guide</a></li> <li><a href="http://www.chimera-bikes.com/style_guide.html" title="Style Guide">Style Guide</a></li> </ul> </div>
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #5  
Old 03-31-2009, 02:55 PM
 
rageon75 rageon75 is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 108
 

Default Re: Changing links from category to static pages

Thanks again for getting back.

What I want to do is have the Horizontal menu display static pages. Right now the menu is linked to the categories which I do not want. If you see the website www.chimera-bikes.com you will notice the left menu and the horizontal menu have the same links. I am trying to separate the two menus. I want the left menu to remain the way it is. I want the Horizontal menu to have the links title "Age Guide", "Size Guide", and "Style Guide" with the links to the static pages.

I tried your suggestion but it just made the menu disappear?

Thanks again for your help.
__________________
X-Cart Gold 4.2 - 4.3 - 4.4.5 - 4.6 - 4.7
Reply With Quote
  #6  
Old 03-31-2009, 04:24 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing links from category to static pages

I'm not sure why the code I posted would make the menu disappear unless you left the {$c.category} variable after removing the foreach loop. I would have to see the page after you made the changes. I would expect that you could put whatever you want in the <div class="hor-categories"> and it would display where you used to have the horizontal category menu.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #7  
Old 04-01-2009, 09:41 AM
 
rageon75 rageon75 is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 108
 

Default Re: Changing links from category to static pages

I am still learning the basics of PHP. I still can not grasp most of the concepts yet. I am probably missing something in another file. I have been trying to learn PHP through Lynda.com. Once I tackle PHP I am going to try for Smarty. Thank you gb2world for all your help.

I think a more simple question would be how to add a Horizontal Menu to the head.tpl and what do I got to add to other files to make it work?

Thanks again.
__________________
X-Cart Gold 4.2 - 4.3 - 4.4.5 - 4.6 - 4.7
Reply With Quote
  #8  
Old 04-01-2009, 10:56 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing links from category to static pages

I think you are already pursuing the easiest way to do what you are trying to do. This change should not involve smarty or php - since you are just trying to hard code a few links that are not coming from the database. I think for this change you just need to understand the html & css. If you make the change and let me look at the resultant page, I may be able to tell you what is wrong that might make it disappear. Otherwise, maybe someone familiar with 4.2 and the Artistic Tunes skin might be able to tell you what you need to know. From what I can see, you should be able to replace what you posted with this and see whatever you put in the hor-categories div:

Code:
<div class="top-categories"> <div class="hor-categories"> Put whatever html/css code you want displayed here - you can use the css classes already set up for you or modify to suit your requirements. </div> </div>
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #9  
Old 04-06-2009, 09:54 AM
 
rageon75 rageon75 is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 108
 

Default Re: Changing links from category to static pages

Hey gb2world, I was able to figure out a way to make the horizontal menu work. I think I over thought the process in the beginning. Here is what I did.

1. I removed the horizontal menu that came with the skin from the head.tpl.
2. I installed a table in the head.tpl (I know I should have used CSS but I just wanted to see if it worked)
3. I created new static pages and linked them inside the table.

Here is the code:

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="35" background="http://www.chimera-bikes.com/skin1/images/custom/hor_categoriesbg.gif"><table width="429" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100"><div align="center"><a href="http://www.chimera-bikes.com/">Home</a></div></td>
<td width="100"><div align="center"><a href="http://www.chimera-bikes.com/pages.php?pageid=10">Age Guide</a></div></td>
<td width="100"><div align="center"><a href="http://www.chimera-bikes.com/pages.php?pageid=11">Size Guide</a></div></td>
<td width="100" height="35"><div align="center"><a href="http://www.chimera-bikes.com/pages.php?pageid=12">Style Guide</a></div></td>
<td><div align="center"></div></td>
</tr>
</table></td>
</tr>
</table>


Here is the link if you want to take a look www.chimera-bikes.com

Thanks again for all your help.
__________________
X-Cart Gold 4.2 - 4.3 - 4.4.5 - 4.6 - 4.7
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 01:43 AM.

   

 
X-Cart forums © 2001-2020