[Skip to main content](#vessel-content)

#   Styling "select" state for menu items (categories)

##

- **[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")**
- [![sdebaun's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4429.png)](/forum/user/4429-sdebaun "View sdebaun's Profile") Topic Author
- [ Offline](/forum/user/4429-sdebaun)

Less More

- Posts: 38
- Thank you received: 0
-
-

14 years 11 months ago [\#30209](#30209) by [sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")  Replied by *[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#30209 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

ok, works for the checkout/cart page (meaning no select state shown) but still getting an unwanted select state when returning to the shop page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")**
- [![sdebaun's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4429.png)](/forum/user/4429-sdebaun "View sdebaun's Profile") Topic Author
- [ Offline](/forum/user/4429-sdebaun)

Less More

- Posts: 38
- Thank you received: 0
-
-

14 years 11 months ago -  14 years 11 months ago [\#30210](#30210) by [sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")  Replied by *[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#30210 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

ok, works for the checkout/cart page (meaning no select state shown). Does nicely show category after selecting product from checkout page (nice!)

However, still getting an unwanted select state when returning to the main shop page (Category view page, none selected).

Edited - Actually, the wrong category (last category) is showing after selecting product from checkout page

Last edit: 14 years 11 months ago by [sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile"). Reason: mistaken regarding product from checkout page

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 11 months ago [\#30246](#30246) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#30246 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

Unfortunately, these are a lot more complex to handle as you would have to do mysql queries to load the information: the category of the current product being displayed, or the default category of the current product/category listing.

You would actually have the same problem if you had 1 menu item per category displayed by joomla with a joomla menu module.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")**
- [![sdebaun's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4429.png)](/forum/user/4429-sdebaun "View sdebaun's Profile") Topic Author
- [ Offline](/forum/user/4429-sdebaun)

Less More

- Posts: 38
- Thank you received: 0
-
-

14 years 11 months ago [\#30255](#30255) by [sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")  Replied by *[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#30255 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

Yes. Thanks for all the efforts, I know you've spent a bunch of time on this already.

I think my best option would be a combination of the edits you have already given me and some css. At this point that's what I'm implementing, my only problem I have is that my default shop page is showing the previously selected category state! There must be some way to clear this, and only set it if selecting a category or product.

I'm trying to figure how to pass another variable to my templates index.php page to stick to the body tags class.

something like:
&lt;?php
$menu =&amp; JSite::getMenu();
$active = $menu-&gt;getActive();
$params = $menu-&gt;getParams( $active-&gt;id );
$class = $params-&gt;get( 'pageclass_sfx' );
?&gt;

&lt;body id ="&lt;?php echo $class ? htmlspecialchars($class) : ''; ?&gt;" class="my_category"&gt;

I can hard code the css to work based on that. Not sure which variable exist and how to grab them though, I figure it's possible with the already generated variables being used by hikashop. I guess I would need to globalize it though?

My categories are unlikely to change, so if my shop page had &lt;body id="shop" &gt;and category pages/item pages were like &lt;body id = "shop" class = "mycategory"&gt;
it would be doable to set the category menu based on that.

...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 11 months ago [\#30289](#30289) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#30289 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

There is already a unique id which is set around the category listing. That is done with the line:
&lt;div id="&lt;?php echo $this-&gt;params-&gt;get('main_div_name');?&gt;" class="hikashop_category_information hikashop_categories_listing_main"&gt;

in the file "listing" of the view "category" of the front end. Is that what you're talking about ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")**
- [![sdebaun's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4429.png)](/forum/user/4429-sdebaun "View sdebaun's Profile") Topic Author
- [ Offline](/forum/user/4429-sdebaun)

Less More

- Posts: 38
- Thank you received: 0
-
-

14 years 11 months ago [\#30362](#30362) by [sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")  Replied by *[sdebaun](/forum/user/4429-sdebaun "View sdebaun's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#30362 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

I'll look into it, thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[goslingcools](/forum/user/2994-goslingcools "View goslingcools's Profile")**
- [![goslingcools's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar2994.jpg)](/forum/user/2994-goslingcools "View goslingcools's Profile")
- [ Offline](/forum/user/2994-goslingcools)

Less More

- Posts: 38
- Thank you received: 0
-
- [](http://www.cobiz.nl)
-

14 years 10 months ago [\#34734](#34734) by [goslingcools](/forum/user/2994-goslingcools "View goslingcools's Profile")  Replied by *[goslingcools](/forum/user/2994-goslingcools "View goslingcools's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#34734 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

Do you have the final listing_list.php (category) ready? I saw it was not included in the latest version of the shop.
And the above attachment listing_list-20111116 is not complete right?

---

COBIZ webdevelopment \| [ ](http://www.cobiz.nl)[ www.cobiz.nl](http://www.cobiz.nl)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 10 months ago [\#34799](#34799) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Styling "select" state for menu items (categories)](/forum/4-how-to/29945-styling-select-state-for-menu-items-categories?start=20#34799 "Any suggestions for creating a select state for category menu items?  I have a nicely functioning menu showing my product categories and I would like to &quot;highlight&quot; the item that corresponds to the category being viewed.  I don't see any &quot;hooks&quot; being generated by the code, I was wondering if you had any suggestions on how to implement this.  This image shows a selected category, but no select state to identify the category chosen  This is my rollover, and hopefully select state as well  Thanks again")*

The latest version is in the current release and it already includes all these changes.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI5OTQ1LXN0eWxpbmctc2VsZWN0LXN0YXRlLWZvci1tZW51LWl0ZW1zLWNhdGVnb3JpZXM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.068 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
