Forums / Templates, Stylesheets, Page Layout / Removing Category Link on Main Page ONLY

Removing Category Link on Main Page ONLY

Views: 1,767

Results 1 to 17 of 17
13 May 2011, 9:02 PM
#1
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Removing Category Link on Main Page ONLY

Hi All!
I've been searching on how to remove the category links from under the images on my main page. I've found out how to remove the links from under the images by following this thread http://www.zen-cart.com/forum/showthread.php?t=84567. However, when I've done that, it removes the link to ALL my subcategories as well. Is there a way I could just remove it from my MAIN page?

Thanks in advance!:smile:

  • oembargain.com
13 May 2011, 10:13 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Removing Category Link on Main Page ONLY

If you want to remove the text only from homepage category listings, you will need a different kind of modification.
Copy /includes/modules/category_row.php to /includes/modules/your_template/category_row.php, and about line 40 find this```php
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');

<span class="categoryTitle"> </span>
exactly as shown to get this```php
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
                                           'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br /><span class="categoryTitle">' . $categories->fields['categories_name'] . '</span></a>');

Then add to your stylesheet

#indexHomeBody .categoryTitle {display: none;}

13 May 2011, 10:18 PM
#3
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

Thanks a lot for your quick reply and help. I really appreciate it. I did exactly as you said and it worked wonders! :clap:

  • oembargain.com
17 May 2011, 8:45 PM
#5
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

Hmm.. now I have another question.... Is it possible to also remove the category links to certain subcategories along with the main page?

  • oembargain.com
18 May 2011, 2:18 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Removing Category Link on Main Page ONLY

Yes, you could do that with per-category stylesheets, each containing the one rule

.categoryTitle {display: none;}

Read /includes/templates/template_default/css/CSS_Readme.txt for more information.

19 May 2011, 8:40 PM
#7
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

Sorry... I still don't really understand...I read the readme.txt file, does it mean I have to create a new stylesheet for each page I want to hide the text for?

  • oembargain.com
19 May 2011, 8:54 PM
#9
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

Ohh, I see. I'm slowly starting to understand because of you. However. how do I find out the page name? ;x

  • oembargain.com
19 May 2011, 9:10 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Removing Category Link on Main Page ONLY

For ez-pages, it is the page id that is important; you can find this in the Tools > EZ-Pages main menu on the left.

19 May 2011, 11:36 PM
#11
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

What about for the Categories / Products page? Could I use those page ids?

  • oembargain.com
20 May 2011, 12:00 AM
#13
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

hmm.. this is what I see in the readme:

The CSS files are sent to the browser in this order: (and alphabetically within each case of more than one match):

         style*.css   // are always loaded and at least ONE should contain site-wide properties.

language_stylesheet.css // changes to ALL pages, when that language is used
** page_name.css // changes to one page **
language_page_name.css // changes to one page, when that language is used
c_????.css // changes to all info pages in a category
language_c
????.css // changes to all info pages in a category, when that language is used
m
??.css // changes to a manufacturer's listing page
language_m_??.css // changes to a manufacturer's listing page, when that language is used
p_??.css // changes to a product's info page
language_p_??.css // changes to a product's info page, when that language is used
print*.css // printer-friendly global usage site-wide changes for printing-only

The 'stylesheet.css' always loads first and should contain the bulk of your CSS selectors. Each file loaded takes priority over previously loaded file(s). To save loading time, only new selectors or selectors whose properties you wish to change should be in the optional CSS files. You can have different overrides for the same page, in different languages, because the two would never be called at the same time.

If someone selected the French language on your site, the 'french_stylesheet.css' would also be loaded. It should only contain the site-wide changes you want to make to 'stylesheet.css'. For example, change a 'background-image' for your French customers.

If someone went to any of the other pages, that page's CSS file would be loaded. Possibly you want different 'background-image' & 'background-color' on each of 'page_x' pages. Possibly you do not want a border around '.plainBox' most of the time, but on a couple of pages you do... and on one of those pages you want it in black and the other in red.

Possibly you created a NEW tag and did a <span class="newtag"> in your Privacy Statement. It is defined in only one CSS file, 'german_privacy.css' as '.newtag { text-transform: uppercase }' Because, in Germany, that phrase must be in all CAPS, but not in other countries.

Use your CSS files and the standard tags as much as possible, just change their properties when needed. If possible, DON'T HACK the core code. Use your CSS files to do the work for you. When the style coding has been removed from the ZenCart code and people have to decide if they want to go without the upgrade or undo all their hacks and finally learn about CSS... your site will still be up and running.

Additional information is contained in the 'read_me' file in the common folder.

Juxi Zoza
03/15/05

The one I bolded seems to make the most sense. However I don't see where it mentions anything about the cPath =[

  • oembargain.com
24 May 2011, 4:47 PM
#15
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

sorry for being such an annoyance... I'm trying to remove the category text from http://oembargain.com/index.php?main_page=index&cPath=145. I made a c_145.css file and included "#indexHomeBody .categoryTitle {display: none;} " in the file but I still see the text. What am I doing wrong?

  • oembargain.com
24 May 2011, 5:15 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: Removing Category Link on Main Page ONLY

#indexHomeBody .categoryTitle {display: none;}
will only work on the home page.
In c_145.css, the simple rule
.categoryTitle {display: none;}
should be effective for that category.

24 May 2011, 5:44 PM
#17
cchan avatar

cchan

Zen Follower

Join Date:
Oct 2010
Posts:
121
Plugin Contributions:
0

Re: Removing Category Link on Main Page ONLY

oh god, I forgot you told me the rule before. Sorry and thanks again! I really appreciated your help! =]

  • oembargain.com