Keyword

Remove title from URL

  • Thomas Thrane
  • Thomas Thrane's Avatar Topic Author
  • Offline
  • Premium Member
More
11 months 6 days ago #173080 by Thomas Thrane
Remove title from URL was created by Thomas Thrane
Hi

When not using SEF, I get this URL of a product:
kr.thrane.nu/index.php?option=com_k2&view=item&id=47:flexowash-plate-cleaner&Itemid=759

How can I get the name after the id NOT to show, so I get:
kr.thrane.nu/index.php?option=com_k2&view=item&id=47&Itemid=759

I need to grab that id, but only the number, not the title.

regards
Thomas

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
11 months 6 days ago #173082 by Fotis
Replied by Fotis on topic Remove title from URL
That's the title alias and you can't easily remove it. But it's dead simple to grab the ID of the K2 item.

Just do (in PHP): $id = JRequest::getInt('id');

And then you can use $id anywhere you want in Joomla.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Thomas Thrane
  • Thomas Thrane's Avatar Topic Author
  • Offline
  • Premium Member
More
11 months 6 days ago - 11 months 6 days ago #173083 by Thomas Thrane
Replied by Thomas Thrane on topic Remove title from URL
Thank you!!!

Please close this!
Last edit: 11 months 6 days ago by Thomas Thrane.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
11 months 6 days ago #173085 by Fotis
Replied by Fotis on topic Remove title from URL
You're welcome :)

(P.S. No need to "close it")

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum