[Solved] How to route to the main category of items

More
12 years 4 months ago #21366 by yopyop001
Hi,

I have a question, not sure to explain it well. Anyway, i try...

I have 2 categories C1, C2
I have 2 items I1, I2
I have 2 menus M1, M2

I1 and I2 are in C1 and C2 (C1 is the main category of I1, C2 is the main category of I2)

M1 is a menu link to flexicontent category C1
M2 is a menu link to flexicontent category C2

When i click on M1, I1, and I2 are displayed. If i click on I2 title, the cid is C1 (the current category id).

Is there a way to pass the main category of the items in the url ?

I hope it's understandable.

Regards

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #21377 by ggppdk
Yes you can use $item->catid instead of $item->catslug
The $item->catslug is current category , and $item->catid is the main category

e.g.
Code:
<a href="<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->catslug));?>" > ...
will be:
Code:
<a href="<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->catid));?>" > ...


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #21426 by yopyop001
That works,
Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.350 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline