Item in two different categories and canonical

More
10 years 7 months ago #46423 by Rooney
Not working for me either:
Main category link (even two canonical links are added):
www.muenstermann.com/en/conveyin ... ovens.html
Other category link: www.muenstermann.com/en/overview ... ovens.html
Rooney

Joomla! 3.9.24 and FC 3.3.9

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

More
10 years 7 months ago #46425 by ggppdk
Hello

instead of
$item->catid

use
$item->maincatid

thus correct code is
Code:
$ucanonical = $base . JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $globalcats[$item->maincatid]->slug));


-- 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
10 years 7 months ago - 10 years 7 months ago #46426 by Rooney
It is working now, but in the non-main category item are still two canonical links in the page header: www.muenstermann.com/en/overview ... ovens.html

Rooney

Joomla! 3.9.24 and FC 3.3.9
Last edit: 10 years 7 months ago by Rooney.

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

More
10 years 7 months ago #46427 by b2z
ggppdk I will apply $item->maincatid solution a little bit later.

BTW Rooney why do you have two canonical links?

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

More
10 years 7 months ago #46428 by Rooney

b2z wrote: BTW Rooney why do you have two canonical links?

Good question. Actually I don't know. Might be added by Joomla?!?
I have also two links when I have a menu item linking to a article directly: www.muenstermann.com/en/overview ... gures.html
Only when I open an article that is listed in category view and this category is the main one I have only one link: www.muenstermann.com/en/conveyin ... ovens.html
Rooney

Joomla! 3.9.24 and FC 3.3.9

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

More
10 years 7 months ago #46440 by b2z
Interesting. We do not have such on our website. Only one canonical.

BTW this code:
Code:
$ucanonical = $base . JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $globalcats[$item->maincatid]->slug));

is working! Now canonical is correct and points to main category. Thank you for fast support! Again :)

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.442 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