Forums / Templates, Stylesheets, Page Layout / Include a tab for "Home" page in the Categories tabs?

Include a tab for "Home" page in the Categories tabs?

Views: 2,742

Results 1 to 20 of 21
1 May 2011, 1:13 PM
#1
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Include a tab for "Home" page in the Categories tabs?

I want to have a tab for "Home" page in the horizontal Categories Tabs.

Please see my website: https://www.fashionlabelstore.com

I want the first tab to be "home" and then "women's fashion", "mens clothing" etc.

Can someone help me to do it...

1 May 2011, 1:14 PM
#2
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Code from my tpl_modules_categories_tab.php

?>

<?php echo '<div id="navCatTabsWrapper">'; echo '<div id="navCatTabs">'; echo '<div id="navCatDropdown">'; echo '<ul class="ul-wrapper">'; $categories_tab_query = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '0' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;"; $categories_tab = $db->Execute($categories_tab_query); while (!$categories_tab->EOF) { echo '<li class="root-cat">'; if((int)$cPath == $categories_tab->fields['categories_id']) echo '<a class="tab-category-top selected-cat" href="'.zen_href_link(FILENAME_DEFAULT,'cPath=' . (int)$categories_tab->fields['categories_id']).'">' . $categories_tab->fields['categories_name']; //echo '<span class="">'.$categories_tab->fields['categories_name'].'</span>'; else echo '<a class="tab-category-top" href="'.zen_href_link(FILENAME_DEFAULT,'cPath=' . (int)$categories_tab->fields['categories_id']).'">' . $categories_tab->fields['categories_name']; //echo $categories_tab->fields['categories_name']; echo '</a>'; $subcategories_tab_query="SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '".(int)$categories_tab->fields['categories_id']."' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;"; $subcategories_tab=$db->Execute($subcategories_tab_query); if($subcategories_tab->RecordCount()>0) { echo '<ul>'; while (!$subcategories_tab->EOF) { $cPath_new='cPath=' . $categories_tab->fields['categories_id'] . '_' . $subcategories_tab->fields['categories_id']; $cPath_new=str_replace('=0_', '=', $cPath_new); echo '<li class="sub-cat">'.'<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">'.$subcategories_tab->fields['categories_name'].'</a></li>'; $subcategories_tab->MoveNext(); } echo '</ul>'; } echo '</li>'; $categories_tab->MoveNext(); } echo '</ul>'; echo '<div class="clearBoth" style="font-size: 0;"></div>'; echo '</div>'; echo '</div>'; echo '</div>'; ?>
1 May 2011, 1:28 PM
#3
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Logging into your website from the link above I can't see your site...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

1 May 2011, 1:39 PM
#4
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

haredo:

Logging into your website from the link above I can't see your site...

please try now.

thanks

1 May 2011, 2:05 PM
#5
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Take time and compare these two .php files with the original from zen cart with the template you are using...

includes/templates/template_default/common/tpl_header.php
includes/templates/<your_template>/common/tpl_header.php

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

1 May 2011, 3:34 PM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

haredo:

Take time and compare these two .php files with the original from zen cart with the template you are using...

I believe the template you have purchased is missing this code..

<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>

Here is a tutorial to read on the issue..

https://www.zen-cart.com/tutorials/index.php?article=234

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

1 May 2011, 7:55 PM
#7
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

I believe this code should be the first line after the

echo '<ul class="ul-wrapper">';
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
2 May 2011, 8:01 PM
#8
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

haredo:

I believe the template you have purchased is missing this code..

<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> ``` > > Here is a tutorial to read on the issue..

When I followed this instruction it places the link above the Category Tabs.

I want the a tab for Home page in the grey colour Categories tab.

I believe i have to tweak the code in this file (posted above) tpl_modules_categories_tab.php

Has someone got a clue??

thanks

2 May 2011, 8:07 PM
#9
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

CoolCarPartsOnline:

I believe this code should be the first line after the

echo '<ul class="ul-wrapper">';

> 
> ```php
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>

I tried this but no luck :(

Category tab just did load at all..

2 May 2011, 8:28 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Include a tab for "Home" page in the Categories tabs?

Both of the suggestions above would display the right output, but need to be altered to work in the specific setting you have. It is already in a PHP environment so doesn't need the <?php and ?>```php
echo '<ul class="ul-wrapper">';

echo '<li><a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . HEADER_TITLE_CATALOG . '</a></li>' . "\n";

2 May 2011, 9:04 PM
#11
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Looks like you are getting closer to figuring out the layout to add Home to your menu...

In the header on the right hand side for search I can't find the box frame is is declared in the stylesheet.css by border:

/includes/templates/fashion/css/stylesheet.css

.search-header-input {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E1E1E1;
float: left;
height: 17px;
padding: 1px 0 0 2px;
}

  1. the highlighted red font about is the fix..
  1. try using #000000;
  1. just a suggestion.. :smile:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

2 May 2011, 10:14 PM
#12
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

:clap:

Thanks guys...I made it!!

I placed the following code below echo '<ul class="ul-wrapper">'; and it worked :)

echo '<li class="root-cat">';
echo '<a class="tab-category-top selected-cat" href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG;

2 May 2011, 10:44 PM
#13
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Perfect look great... Nice work...

Notice my post in #11....

Also when I clicked the add to the cart for this product, I purposly did not click a size?
This is what the shopping cart reveals??
http://www.fashionlabelstore.com/index.php?main_page=shopping_cart&number_of_uploads=0

Notice no size...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

3 May 2011, 12:34 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Include a tab for "Home" page in the Categories tabs?

Using the "root-cat" class will give your home link the same styling as the top cats - good work. You do need to close the <li> with a </li> after the HEADER_TITLE_CATALOG; as what you have causes an HTML error that cascades to make more errors:
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.fashionlabelstore.com%2Findex.php%3Fmain_page%3Dindex%26cPath%3D1_5%26zenid%3D8te1bsd60nse1iig1kevsgfjl3

Also, the

. DIR_WS_CATALOG . '">'; ?><?php echo HEADER_

while not erroneous is an odd and unnecessarily complicated way of writing what could be just

. DIR_WS_CATALOG . '">' . HEADER_

4 May 2011, 10:29 PM
#15
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

haredo:

Perfect look great... Nice work...

Notice my post in #11....

Also when I clicked the add to the cart for this product, I purposly did not click a size?
This is what the shopping cart reveals??
http://www.fashionlabelstore.com/index.php?main_page=shopping_cart&number_of_uploads=0

Notice no size...

thanks for pointing out. im working on it.

5 May 2011, 12:12 AM
#16
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

gjh42:

Using the "root-cat" class will give your home link the same styling as the top cats - good work. You do need to close the <li> with a </li> after the HEADER_TITLE_CATALOG; as what you have causes an HTML error that cascades to make more errors:
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.fashionlabelstore.com%2Findex.php%3Fmain_page%3Dindex%26cPath%3D1_5%26zenid%3D8te1bsd60nse1iig1kevsgfjl3

Also, the

. DIR_WS_CATALOG . '">'; ?><?php echo HEADER_

while not erroneous is an odd and unnecessarily complicated way of writing what could be just

. DIR_WS_CATALOG . '">' . HEADER_

when i add </li> after the HEADER_TITLE_CATALOG;

the cat tabs and contents below that doest seem to load.

5 May 2011, 12:14 AM
#17
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

I just noticed that the "home" tab in the categories tabs appears funny when i view it from IE or iphone.

It looks alright when i select compatibility view in IE. How can i fix this issue?

5 May 2011, 12:38 AM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Include a tab for "Home" page in the Categories tabs?

when i add </li> after the HEADER_TITLE_CATALOG;Sorry for the brief comment - you need to add it the right way for it to work.
HEADER_TITLE_CATALOG is a PHP constant, and to add HTML output after it you need to enclose it in quotes, like this```php
HEADER_TITLE_CATALOG . '</a></li>';

You do not show where you close the <a class="tab-category-top... link with </a> in your snippet; if you do not have that, it will cause another HTML error. If you do have it, the </li> must be just after it.
5 May 2011, 1:21 AM
#19
blonde avatar

blonde

New Zenner

Join Date:
Mar 2011
Location:
Europe
Posts:
11
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Works fine now :)

thanks again.

5 May 2011, 1:26 AM
#20
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Include a tab for "Home" page in the Categories tabs?

Site is lookin good now...

but as a perspective buyer and want to search I don't see a dark enough frame around the search box in the top right hand corner..

includes/templates/fashion/css/stylesheet.css

.search-header-input {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E1E1E1;
float: left;
height: 17px;
padding: 1px 0 0 2px;
}

  1. the highlighted red font above is the fix for you..
  1. just change to another color..

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.