Zen Cart Logo
Forums / General Questions / Remove some category links from header bar

Remove some category links from header bar

Views: 6,350

Results 1 to 20 of 35
31 Dec 2008, 8:39 PM
#1
starruby avatar

starruby

Zen Follower

Join Date:
Nov 2007
Posts:
96
Plugin Contributions:
0

Remove some category links from header bar

Hi,

How do I remove links from the header categories bar? I have some "Document-General" categories which I do not want listed on the top header bar. Which file do I need to edit to stop some categories from appearing there? I successfully removed the categories from the drop down menu, but am unable to remove them from the categories bar.

Store url: http://www.starruby.in/store

Thanks,
Harshil

31 Dec 2008, 11:43 PM
#2
colemanpa avatar

colemanpa

Zen Follower

Join Date:
Oct 2007
Location:
Fairbanks, Alaska
Posts:
423
Plugin Contributions:
0

Re: Remove some category links from header bar

look under admin, configuration, layout setting, Categories-Tabs Menu ON/OFF

try that, I am not sure with your template but it mite work.

pete

1 Jan 2009, 3:40 AM
#3
starruby avatar

starruby

Zen Follower

Join Date:
Nov 2007
Posts:
96
Plugin Contributions:
0

Re: Remove some category links from header bar

colemanpa:

look under admin, configuration, layout setting, Categories-Tabs Menu ON/OFF

try that, I am not sure with your template but it mite work.

pete

Well that would turn off the categories tabs menu completely. What I want to achieve is just remove some links from the tabs menu (the documents-general links, which I dont want there).

Thanks,
Harshil

1 Jan 2009, 4:07 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

See if this works for you on the categories_tabs.php module down near the bottom of the file:

  if (zen_get_product_types_to_category($categories_tab->fields['categories_id']) == 3) {
    // skip it
  } else {
    // create link to top level category
    $links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';
  }
1 Jan 2009, 4:29 AM
#5
starruby avatar

starruby

Zen Follower

Join Date:
Nov 2007
Posts:
96
Plugin Contributions:
0

Re: Remove some category links from header bar

Ajeh:

See if this works for you on the categories_tabs.php module down near the bottom of the file:

if (zen_get_product_types_to_category($categories_tab->fields['categories_id']) == 3) {
// skip it
} else {
// create link to top level category
$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';
}


Hi Linda,

Thanks for your help. I tried adding that code near the bottom of categories_tabs.php, however it doesn't change anything.
1 Jan 2009, 4:37 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

The original code reads:

  // create link to top level category
  $links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';

That code replaces it ...

Note: the categories do need to be Document General for that to work ...

1 Jan 2009, 4:43 AM
#7
starruby avatar

starruby

Zen Follower

Join Date:
Nov 2007
Posts:
96
Plugin Contributions:
0

Re: Remove some category links from header bar

Ajeh:

The original code reads:

// create link to top level category
$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';

> 
> That code replaces it ...
> 
> Note: the categories do need to be Document General for that to work ...

Thanks Linda.. worked perfectly :smile:

Happy New Year to you and your family.

Regards,
Harshil
1 Jan 2009, 4:46 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

And a very Merry New Year to you and your's ... :smile:

Glad that that worked for you and sorry I didn't post the original code before to make it clearer for you ... but, alas, I had a lazy moment ... :cool:

1 Jan 2009, 4:50 AM
#9
starruby avatar

starruby

Zen Follower

Join Date:
Nov 2007
Posts:
96
Plugin Contributions:
0

Re: Remove some category links from header bar

Ajeh:

And a very Merry New Year to you and your's ... :smile:

Glad that that worked for you and sorry I didn't post the original code before to make it clearer for you ... but, alas, I had a lazy moment ... :cool:

I was lazier... I should have figured it out !

1 Jan 2009, 4:52 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

I never said that ... :p

1 Jan 2009, 4:57 AM
#11
starruby avatar

starruby

Zen Follower

Join Date:
Nov 2007
Posts:
96
Plugin Contributions:
0

Re: Remove some category links from header bar

Ajeh:

I never said that ... :p

You people are so helpful that even if I am sure I can find the solution to a problem, I can't resist posting here! :wink:

21 Jan 2009, 1:08 AM
#12
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Remove some category links from header bar

I'm looking for something along these same lines. Would like one look or the other whichever is easier to get working :smile:.

  1. Remove the Categories from the header tab, but keeping the graphic line.

  2. If impossible to keep just the line, have only a select few Cats show. I want this on all of my sites because I will have too many Cats and it just makes that darn image grow and grow..lol.. it will take over my page!

Here is one of the shops :
http://www.lilleypadcove.com/lilleypadgifts

Want the pretty line divider, don't want the endless list of cats ...possible? :smile:

21 Aug 2010, 8:03 PM
#13
writeathome avatar

writeathome

New Zenner

Join Date:
Dec 2008
Posts:
50
Plugin Contributions:
0

Re: Remove some category links from header bar

Ajeh:

See if this works for you on the categories_tabs.php module down near the bottom of the file:

if (zen_get_product_types_to_category($categories_tab->fields['categories_id']) == 3) {
// skip it
} else {
// create link to top level category
$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';
}


Hi Ajeh,

I know this thread is old but I have a similar situation. I want to take off a couple of Product - General categories from my category header bar. This code you mentioned was specifically for Document - General category items. 

Can I use the code for the Product - General categories, and if so, what coding needs to be changed to work?

thank you!

Kim
22 Aug 2010, 3:45 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

To skip categories_id 13 and 47, change the IF to read:

if ($categories_tab->fields['categories_id'] == '13' || $categories_tab->fields['categories_id'] == '47') {
23 Aug 2010, 10:41 PM
#15
writeathome avatar

writeathome

New Zenner

Join Date:
Dec 2008
Posts:
50
Plugin Contributions:
0

Re: Remove some category links from header bar

Thank you Ajeh! Worked perfectly!:clap:

24 Aug 2010, 2:21 AM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

Thanks for the update that this was able to work for you ... :smile:

26 Aug 2010, 5:50 AM
#17
writeathome avatar

writeathome

New Zenner

Join Date:
Dec 2008
Posts:
50
Plugin Contributions:
0

Re: Remove some category links from header bar

Along the same lines . . .

I want to add a short description under each category name only in the category header bar. Specifically I want the category description text (which will be really short) under the category name.

Here is an example: http://blog.wallvinyldecal.com/testimonials/

My guess is that I need a line of code (or add a section of code) to the categories_tabs.php page.

Any help would be greatly appreciated.

Thank you!

Kim

26 Aug 2010, 2:05 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

You would need to customize the code some more to catch the specific categories_id and get the text that you want ...

You might try something like this:

// bof: add tag line to categories
  switch((int)$categories_tab->fields['categories_id']) {
    case (1):
      $cat_tag = '<span>' . 'Happy Days!' . '</span>';
      break;
    case (2):
      $cat_tag = '<span>' . 'Hello World' . '</span>';
      break;
    default:
      $cat_tag = '<span>' . 'No Clue: ' . (int)$categories_tab->fields['categories_id'] . '</span>';
      break;
    }

  // create link to top level category
  $links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ' . $cat_tag;

// eof: add tag line to categories

See if that gets you in the right direction ...

NOTE: I stuck the <span> tags in there just to show that you could ...

31 Aug 2010, 3:46 AM
#19
writeathome avatar

writeathome

New Zenner

Join Date:
Dec 2008
Posts:
50
Plugin Contributions:
0

Re: Remove some category links from header bar

Ajeh, as always you are right on the money with your coding. Thank you!

As it stands, the cat tags are sitting to the right of the category name. I would like them underneath the category name they are attached to.

Is there some way to limit the width of each category name section so that the cat tag has to wrap to the next line?

Or is there some coding I can add to the cat tag to position it under the category header?

Or could I move the cat tag coding outside the category tag code and place it below, independent from the category tag code?

Whatever is the easiest would be fine with me. Although the third option seems like it would satisfy another issue I have with the cat tags being forced to use the cufon I have set up with the header. I can't seem to disable it for the cat tags only.

Here is a link to what it looks like now: http://www.wallvinyldecal.com/designs/index.php?main_page=index&cPath=70

Here is a link of what I want it to look like: http://blog.wallvinyldecal.com/testimonials/

Your help is much appreciated!

Kim

31 Aug 2010, 1:51 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove some category links from header bar

What happens if you change:
. $cat_tag

to read:
. '<br />' . $cat_tag

Does this work for you? :unsure: