[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 #58972 by Ninjakitten
I really, really don't like having the numbers and '/category/' in my URLs. I don't want to swap having /category/ for having /item/, either. I can't afford to buy an extension to do SEF, and it doesn't look like there's a free one that can handle flexicontent.

It looks like this has come up many times before and you're dead set on having the URLs like that and not adding an option to lose the numbers and such, so I figured I'd give in and make hidden menu items for Every. Single. Category. to at least get the /category/ and number out of category URLs, but then I found that while the default links give a cid of ##:name (like 80:felix), making a flexicontent category menu item only gives you a cid of ## (like 80). This is a problem, because my work-around for displaying fields in the description area of category views uses the name portion of the cid, so losing that breaks the whole system.

I thought well, okay, fine, I'll find the category menu item type, clone it, and change where it has cid=## to cid=##:name. I found where the menu item type is defined. But... I can't seem to find where it actually creates the 'Link' when the category's chosen.

So, could you please tell me how I can make a menu item type that clones the one for category except using a link of "index.php?option=com_flexicontent&view=category&cid=80:felix" instead of "index.php?option=com_flexicontent&view=category&cid=80"? Or are there any free SEF components which actually work with Flexicontent? Some other way to do it I haven't thought of yet? I'd just do standard URL rewriting, except there's no way for me to know what numbers I'd have to add into the urls to make them work.

Overall I'm really liking this component, but this aspect is really driving me up a wall. Yes, it's a cosmetic issue, but that doesn't mean it doesn't matter.
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 #58981 by ggppdk
Hello

about alias,
recently found and fixed a bug that category alias was not included

maybe it is the case that you mention
- you can test on a test server this build:
github.com/FLEXIcontent/flexicontent-cck/releases


-- 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 #58997 by Ninjakitten
I've been able to test this build, now, and sadly whatever the bug was, it apparently wasn't the problem I've got. Making a menu item to point to a category still creates a link like index.php?option=com_flexicontent&view=category&cid=80 instead of one like index.php?option=com_flexicontent&view=category&cid=80:felix.

Is there another way I can make it create the right link? Where is the link even created?
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 #59000 by ggppdk
Hello

the fix i was talking about, is for category URLs that are not menu items

- for menu items you do not need the category-alias because the SEF url will only show the menu-item-alias
- joomla category links for category menu items are similar, they do not have the alias
e.g. the following is a menu item when SEF URLs are disabled
index.php?option=com_content&view=category&layout=blog&id=225&Itemid=1270&lang=en


-- 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 #59002 by Ninjakitten
No, for menu items I DO need the category alias, because as I said, that's what I used as the basis for my workaround to allow fields to work in the body of category pages. Without that, it breaks. I need the menu link to include the :name portion.

Please tell me where it's done, so I can fix it (for my purposes) myself. I've looked and failed to find it thus far. I don't want /category/ and I do NOT want the number showing, and the only way to fix that is apparently an SEF plugin I can't afford or using menu items, which is really an unreasonable amount of time and effort since I'll have to do it for every category, but it annoys me enough that I'm willing. But it's no good because the :name portion isn't in the menu's link and I can't force it to be, so it breaks my code.

All I'm really asking here is to know where the code that decides what the link to the category is is located, so that I can make myself a version that adds in the :name. Thanks.
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 #59003 by ggppdk
Hello

adding alias will not be a security problem since it is always casted to int by the model
- but it will break the routing code that reads the menu items from DB, there are operators == that assume that the value is integer
- the alias in menu items, will not be updated if you edit and change the alias of the category

can you explain how you are using, and how it is related to fields ?

my work-around for displaying fields in the description area of category views uses the name portion of the cid


- 1. what do you do with the fields in relation to the category title alias ?
- 2. and why get the category alias this way ? if you have the category id, then you can get the category alias in simpler and -safer / more secure - way


-- 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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.728 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