Closed shoulders closed 9 years ago
Hi,
This is not the title, it's the alias of the item which is used with the id. Even if you change the alias the link will continue working. There is no way to make this dynamic since the result link is stored in the text of the item and it's just plain data.
what i meant was if you remove the alias which is not required, the link would effectively become dynamic because if you altered the title of the k2 article/url it would make no difference the link would still link to the same article.
this is all that is needed
'index.php?option=com_k2&view=item&id=564'
As i explained in my previous message, the link will still work even if you change the title/alias.
thanks for the feedback..
If you can point me to the right place in the code i will remove it myself. I really don't want scruffy code in my articles. The additional of the alias to the end of the K2 link is from what i can see pointless and confusing.
It's not pointless. Actually it's required in order to build the correct link and not a link that it just works. in any case if you want to modify the plugin the code that generates the item link can be found at https://github.com/joomlaworks/K2-Links-for-JCE/blob/master/k2links/k2.php#L181
The titles in the link are not required. I regurlary make links removing the title and they work fine. This might be a relic from Joomla 1.5.
No, it's not. It's part of how Joomla non-SEF URLs work. Even com_content articles are like so.
It works on my site with no issue. Here is an example. they all point to the same article without issue.
Just to be clear. it is in the non-sef URL I want to remove the title from.
Am I missing something?
thanks
I know, cause you've raised this before. The router needs a minimum of things to be able to determine where to redirect a request in K2. That's why it also works without the alias. But that doesn't mean there's a switch to flip this on and off in Joomla.
If you MUST get rid of the alias, it's best to do so in a custom system plugin that can scan the entire body output, match all "id=X:Y" and then strip the ":Y" part. But it's really beyond the score of this extension or K2 in general.
I have written a module that gives me the correct URLs and I have been using this. It is a module so i browse to the article i want and it displays the non-SEF URL which i can thn copy and paste in anywhere in Joomla which then correctly routes it. I also have added an option to remove the title alias.
This article selector for k2 could do the same thing. My Module also helped with Kunena for which i now no longer need to use alias menu items for correct routing.
So far it is only k2 that I have found that adds the alias into the non-sef URLs.
If I get change I will look at the k2 router and see if i can remove it, however I will accept your advice.
thanks
the extension seems to work as expected but i have noticed an issue with the links to articles it creates.
the link it creates to one of my articles:
index.php?option=com_k2&view=item&id=564:diagnose-paypal-issues-in-prestashop
if you notice at the end it has included the articles title. This is a bad thing because if you change the articles name you would have to go through the all the database and articles where this link has been used.
The articles name should be removed from the end of the link so that the links are always dynamic and correct.
I have removed the :diagnose-paypal-issues-in-prestashop from the url and the links still works.
index.php?option=com_k2&view=item&id=564
I would rather not have to remove this on every link creation, i know it is a little thing but for me it adds time to my workflow