Announcement

Collapse
No announcement yet.

Hide specific category in category tree?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hide specific category in category tree?

    Hi.
    How can I hide a specific category (or categories) from appearing in the category tree?

    Thank you,
    Ben


    #2
    You would need to add some logic to the category tree template to hide them, We'll typically tie it to a custom category field and that you can control which are hidden by setting a custom category fields to hide.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      There is an example of adding logic to the category tree template in the Reference guide (page 519) but it looks like the example code is wrong. Below is what the guide coaches. Would love some help getting the correct code to insert in the Category Tree Template as this would be a Very Useful Feature.

      5.1. Go to > User Interface > Settings tab > Category Tree Template tab.

      5.2. Add the field. In the Custom Fields section, click on the field named "Display", then click the Select button. (To reduce overhead in the admin interface, only custom fields that have been selected can be referenced in the template code.)

      5.3. Edit the template code. In the category tree template code we'll add code to scan the value of the "Display" field for each category. Categories where the Display field contains the string "true" will be shown in the category tree.



      5.4. The new code we'll add to the template field is:

      <mvt:if expr="NOT
      ISNULL(l.settings:cattree_category:customfield_val ues:customfields:msrp)">
      Custom Field Name:
      &mvte:cattree_category:customfield_names:customfie lds:msrp; <br/>
      Custom Field Value:
      &mvte:cattree_category:customfield_values:customfi elds:msrp;
      </mvt:if>
      1. Add category tree template code. In our example we'll use the custom field to control whether a category is displayed in the category tree. If the value of the custom field is "true", the category will be displayed in the on-line store.
      2. When you've finished making your changes to the Category Tree Template tab, click the Update button.
      Matt E.
      www.harpkit.com

      Comment


        #4
        Ben,

        I have a "hack" that I use to accomplish this that doesn't require much setup.

        I create an Inactive Category (mine is called Hidden Categories) and then I assign all categories I want to hide as Child Categories to the Hidden Category. I use this for things like seasonal categories that I want to have hidden until the appropriate time.

        The categories can still be accessed by direct link, but they are not displayed in the Category Tree.

        Psydde
        Psydde Delicious
        Delicious Boutique & Corseterie
        Philadelphia, PA
        www.DeliciousBoutique.com
        www.DeliciousCorsets.com

        Comment

        Working...
        X