Keyword

ID Category Prefix Won't Go

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 2 days ago #147873 by Krikor Boghossian
Replied by Krikor Boghossian on topic ID Category Prefix Won't Go
Stupid questions following:
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.

More
9 years 2 days ago - 9 years 2 days ago #147877 by acidrain_lnx
Replied by acidrain_lnx on topic ID Category Prefix Won't Go
Hi again:

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.
Last edit: 9 years 2 days ago by acidrain_lnx.

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

More
8 years 11 months ago #148014 by acidrain_lnx
Replied by acidrain_lnx on topic ID Category Prefix Won't Go
Hello:

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 11 months ago #148142 by Krikor Boghossian
Replied by Krikor Boghossian on topic ID Category Prefix Won't Go
Thank you so much for your feedback :)

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.


Powered by Kunena Forum