Keyword

SH404SEF using generated alias, instead of actual alias

  • bkemler
  • bkemler's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 4 months ago #76113 by bkemler
I searched for this issue but didn't see any posts about this exact problem.

I'm using K2 v 2 final and the most recent version of SH404SEF (1.5.4.302). Everything is working great except... if a K2 item has an alias that's different than the one that K2 would generate automatically, it doesn't get inserted into the URL... it gets the automatically generated alias.

Sooo... an item with the Title "About President Obama" but a manually created alias of "about-p-o" would show up in the URL as "about-president-obama". I could live with this except for the fact that it doesn't seem to strip characters out of the automatically generated alias so an item titled "About Mr. Obama" would end up with a URL of "about-mr.-obama", which obviously wouldn't work. And then to fix it, you not only have to change the title of the item but you also have to purge the SH404SEF URL cache. This is definitely a problem for a site with content generated by users other than the webmaster...

Help? Is there a setting I need to change somewhere?

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

  • bkemler
  • bkemler's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 4 months ago #76114 by bkemler
Another issue with SH404SEF... When it's enabled and I click on a tag to view all items with that tag, it doesn't inlcude the Component Heading "Displaying Items Tagged:", like it does when I have it turned off.

Any ideas?

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

  • bkemler
  • bkemler's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 4 months ago #76115 by bkemler
I figured out fixes for these in case they're problematic for anyone else...

To have SH404SEF use item aliases in URLs, instead of titles, go to the k2 set_ext file... At line 92, change "SELECT title" to SELECT alias... and at line 102, change $row->title to $row->alias

To have the generic view include the component heading, go into the generic.php file (if you haven't already, copy the contents of /components/com_k2/templates to /templates/[yourtemplate]/html/com_k2/templates so that you don't lose your changes if you upgrade to a future version of k2). Take out the php if function on line 19 and the php endif on line 24. This means that your generic view will always include the component heading but that's what I wanted so I didn't bother to try to figure out if it's possible to get the results the more proper way (by getting SH404SEF to carry the menu Itemid of the item you're looking at over to the generic view).

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

More
14 years 4 months ago #76116 by Matthieu Brunet
Replied by Matthieu Brunet on topic SH404SEF using generated alias, instead of actual alias
There is the same problem for categories : the name is used instead of the alias. You can fix it the same way, by editing the k2 sef_ext files (components/kom_k2/sef_ext/com_k2.php) at line 35 :
replace $row->name by $row->alias

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


Powered by Kunena Forum