[SOLVED] non-SEF category / item urls that originate directly from menu items, do not add the category / item alias to the URL

More
9 years 6 months ago - 9 years 6 months ago #59005 by Ninjakitten
I could deal with having to reset the menu items if I changed an alias, but breaking the routing code definitely seems like a deal-breaking kind of issue. Drat. Thank you for letting me know!

Basically, what I've done is create unpublished items which use normal fields to hold the data for the 'page' that each category is, and then a number of 'display' plugins which are in the category's template, up in the area defined by category_category; obviously I've set up custom templates to create a few spots up there as well. The display plugins use the second half of the cid to match the category alias with the item of type 'data' with the same alias, and pull the information out of that. It works fairly nicely, for my purposes. (Also, because of this, changing a category alias is rather unlikely and would break more than the menu item if I did it, so that's why that part doesn't concern me so much. ;) )

I suppose the safest way would be to rewrite all the display plugins to get the category alias from the category number, since that will always be there and I can't think how it'd break anything else. I originally grabbed the alias from the cid because it avoided an extra db query, but is there a better way?
Last edit: 9 years 6 months ago by ggppdk.

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

More
9 years 6 months ago - 9 years 6 months ago #59006 by ggppdk
Hello

getting a single category row or (several category rows with a single query)
- by using ID or IDs
- and without order clause in the query
- and on category table that has < 2000 categories

will / should cost almost minimal almost zero time


-- 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...
Last edit: 9 years 6 months ago by ggppdk.

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

More
9 years 6 months ago - 9 years 6 months ago #59007 by ggppdk
Also if you do not need falang to translate the alias

you can use an object created by flexicontent system plugin (which is retrieved from Joomla cache):
Code:
global $globalcats; $jinput = JFactory::getApplication()->input; $cid = (int) $jinput->get('cid', '', 'int'); $cat = isset($globalcats[$cid]) ? $globalcats[$cid] : false; if ($cat) echo "Category slug is: ".$cat->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...
Last edit: 9 years 6 months ago by ggppdk.
The following user(s) said Thank You: Ninjakitten

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

More
9 years 6 months ago - 9 years 6 months ago #59008 by Ninjakitten
I don't need translation on this project, so I'll give that second option a go. Thanks very much!
Last edit: 9 years 6 months ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.753 seconds
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
Save