You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#112321 Link Tool Adding Item ID to SEF URLs

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Friday, 18 November 2022 15:04 GMT

RedEvo
Hi,

We use JCE on multiple sites but lately we have come across and issue. We have many clients who we are constantly refreshing content for, which sometimes means creating a duplicate article or menu link for developing the new content before then switching it to be the live version. Whilst the menu item alias remains the same on these updates, the menu item ID or K2 Item ID changes, which then causes any internal links to these pages to break as they IDs no longer match up. We were planning to start adding the links in manually, to allow us to get the SEF version of them however I thought I would have a look at the settings within the link plugin first to see if it could be done automatically using the link picker tool. I have disabled all the settings for adding Item IDs to the urls and enabled the Convert to SEF setting, which has worked to an extent but the Item ID still gets added to the end of the url. So instead of a URL being "about/why-us" it's being added in as "about/why-us/item/186", which isn't very SEF.

Is this a bug with the plugin or have I just missed to change a setting which will remove that?

Thanks,
Dave

Attachments

Ryan
I have disabled all the settings for adding Item IDs to the urls and enabled the Convert to SEF setting


Disable the Convert to SEF option. Is the ItemID still added?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

RedEvo
If I disable that option, it changes the url back to the "index.php?option=com_k2&view=item&layout=item&id=186&Itemid=940" style url, which is the style we don't want.

Ryan
It is best practice to leave the link in its "raw" state, as the Joomla SEF plugin is responsible for converting it into a SEF url when the content is rendered in the front-end.

The Itemid can also only be removed if the link is in the raw format.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

RedEvo
The problem we have though, when it's in it's raw format, if we update the menu link or article link it breaks all the internal links we have going to that page. We have had this issue crop up on a couple of client sites and we've had to then go through all the content on the sites to find all the links and manually update them. So are you saying it's not possible for JCE to add a clean SEF link to the articles using the link picker tool?

Ryan
So are you saying it's not possible for JCE to add a clean SEF link to the articles using the link picker tool?


Only if the link is in it's raw format.

If you set it be a SEF link, then it has it's own issues, as any changes to the menu or alias of the article that it is linked to, will break the link. The raw link ensures that this won't happen, as the SEF url is always created when the page is rendered.

If you are having issues with the raw URL link, then the cause may be elsewhere, link in the associated menu items.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

RedEvo
Well there definitely is an issue with updating the menu links in the raw format. It does indeed render a fully SEF url but it doesn't update the raw links created throughout the site when we update the menu ID or article ID. It sounds like we will just have to manually add the SEF links in ourselves rather than using the link picker tool.

Ryan
It does indeed render a fully SEF url but it doesn't update the raw links created throughout the site when we update the menu ID or article ID.


Nothing does that. This is neither a feature of Joomla or JCE. Once a link in content is saved to the db (in whatever format), it can only be changed by updating the content.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

RedEvo
I know, that's why I was wanting to render the links as SEF urls and save them in the db like that.

Ryan
So instead of a URL being "about/why-us" it's being added in as "about/why-us/item/186", which isn't very SEF.


The "item" part of this link is not the itemid, but the article id of the K2 item.

You can see it here in the link - index.php?option=com_k2&view=item&layout=item&id=186&Itemid=940 - which is resolved by the K2 router to about/why-us/item/186

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.