- Posts: 4
COMMUNITY FORUM
ID Category Prefix Won't Go
- dylan tucker
-
Topic Author
- Offline
- New Member
I can't stop K2 showing the category ID in the url such as : www.mysite.com/blog/2-categoryname/
I'm running 2.6.9 and have changed the parameters as follows:
Enable advanced SEF for K2 URLs: yes
Use the category ID in the URL: no
Use the category title alias: yes
I've checked and no number is in the alias itself, and I've created new categories to check and it does it still.
Have also cleared browser case, disabled joomla cache and disabled system cache plugin.
Any ideas?
Thanks!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Does this category belong to a menu item?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- dylan tucker
-
Topic Author
- Offline
- New Member
- Posts: 4
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
We will look into it.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You can get it from:
The patch that fixes it is located here: getk2.org/assets/get/
github.com/joomlaworks/k2/commit/4371e2e8571e9c0d94ee23723da5084f6ecf9435
PS. You are highly advised to backup first.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- dylan tucker
-
Topic Author
- Offline
- New Member
- Posts: 4
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- acidrain_lnx
-
- Offline
- New Member
- Posts: 5
I have the same problem, but that file doesn't worked for me.
I'm using 2.6.9 K2 Component and i have the same settings than the first person who opened the topic.
But my URL SEF is always: www.domain.com/blog/CATID-category/my-post
If i set the value "show ID category" to NO/YES, the CATID is always printed on the URL.
I can show/hide the ID article, but ID Category is always before the category name.
I don't know what is happening.
Best regards.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
It has been fixed in the DEV version.
You can get it from:
The patch that fixes it is located here: getk2.org/assets/get/
github.com/joomlaworks/k2/commit/4371e2e8571e9c0d94ee23723da5084f6ecf9435
PS. You are highly advised to backup first.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- acidrain_lnx
-
- Offline
- New Member
- Posts: 5
Thanks Krikor, but that solution is not valid for my website. I've downloaded that new fixed file router.php and "replace" my actual file and the website is always insert the ID category:
You can see the example in this screenshot (.........../4-gnu-linux/ ... instead ........./gnu-linux/... )
s17.postimg.org/kfk9hoqb3/id_category.png
I'm using 2.6.9 K2 and i'have NO the "show ID category on URL" and "show ID item on URL", but only for ITEM element works.
Thanks and best regards from spain
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
What is the actual alias of the category?
Have you purged your cache?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- acidrain_lnx
-
- Offline
- New Member
- Posts: 5
No problem about your stupid questions :).
1.- Here you have a select about my name & alias categories for K2 component. As you can see, all of them has only letters.
mysql> select id,name,alias from lln4b_k2_categories;
+----+-----------------------+-----------------------+
| id | name | alias |
+----+-----------------------+-----------------------+
| 1 | Blogs | blogs |
| 2 | Blog/Web | blog-web |
| 3 | Edición de video | edicion-de-video |
| 4 | GNU/Linux | gnu-linux |
| 5 | GoPRO | gopro |
| 6 | Edición de fotografía | edicion-de-fotografia |
| 7 | Mi Blog | mi-blog |
| 8 | Blog Quotes | blog-quotes |
| 9 | Blog Media | blog-media |
| 10 | Blog Photo | blog-photo |
| 11 | Blog Gallery | blog-gallery |
| 12 | Demo home slide | demo-home-slide |
| 13 | Blog masonry | blog-default |
| 14 | Composition sites | composition-sites |
| 15 | Prints retro | prints-retro |
| 16 | Web design | web-design |
| 17 | Photo and vector | photo-and-vector |
| 18 | Retro infographic | retro-infographic |
| 19 | Image Only | image-only |
| 20 | RPF | rpf |
| 21 | Index5 | index5 |
| 22 | Feature | feature |
| 23 | News | news |
| 24 | Technology | technology |
| 25 | Photo news | photo-news |
| 26 | World news | world-news |
| 27 | Random News | random-news |
| 28 | Latest News | latest-news |
| 29 | Entertainment | entertainment |
| 30 | Video | video |
| 31 | Photo | photo |
| 32 | Games | games |
| 33 | Hacking | hacking |
| 34 | Internet | internet |
| 35 | Monitorización | monitorizacion |
| 36 | Packet Tracer | packet-tracer |
| 37 | Pequeños trucos | pequenos-trucos |
| 38 | RaspberryPi | raspberrypi |
| 39 | Redes | redes |
| 40 | Shells | shells |
| 41 | Snowboard | snowboard |
| 42 | Viajes | viajes |
| 43 | Webs | webs |
| 44 | Windows | windows |
| 45 | Reflexiones | reflexiones |
| 46 | PORTFOLIO | portfolio |
| 47 | Diseño Web | diseno-web |
| 48 | Otras cosas | otras-cosas |
| 49 | Edición de videos | edicion-de-videos |
| 50 | Fotografías | fotografias |
| 51 | Animales | animales |
| 52 | Conceptuales | conceptuales |
| 53 | Deportes | deportes |
| 54 | Editadas | editadas |
| 55 | Monumentos | monumentos |
+----+-----------------------+-----------------------+
55 rows in set (0.00 sec)
About my cache, I deleted it a lot of times. I don't use 3er party cache components, only Joomla and K2.
I'm not a developer, only a Sysadmin and i have been checking the code inside router.php and I found the line to build that part of URL ( category+id)
// Replace the item with the category slug
if ($params->get('k2SefLabelItem') == '1')
{
$segments[0] = getCategorySlug((int)$ItemId); <-- THIS IS THE LINE IN MY CASE
}
else
{
$segments[0] = $params->get('k2SefLabelItemCustomPrefix');
}
For example, if I change that line to this:
$segments[0] = "TESTING";
My URLS change to www.domain.com/blog/TESTING/item-title-alias
I'm trying to get only the "category alias name" and asign that value to "$segments[0]". I think this would be a workaround in my case.
For example: $segments[0] = getCategorySlug((ItemTitleAlias)$ItemId); (or similar, I don't know the code and variables for K2)
Thank you for your help.
Please Log in or Create an account to join the conversation.
- acidrain_lnx
-
- Offline
- New Member
- Posts: 5
I fixed my probelm with this little php fix code:
// Replace the item with the category slug
if ($params->get('k2SefLabelItem') == '1')
{
$segments[0] = getCategorySlug((int)$ItemId);
$part = explode("-", $segments[0]); // MY HACK WORKAROUND
$segments[0] = ($part[1]); // MY HACK WORKAROUND
}
else
{
$segments[0] = $params->get('k2SefLabelItemCustomPrefix');
}
Two lines has been added.
best regards
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
We will test it on our side as well.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.