- Posts: 22
COMMUNITY FORUM
Jump to item
- Big Ron
-
Topic Author
- Offline
- Junior Member
Less
More
10 years 3 months ago #136132
by Big Ron
Jump to item was created by Big Ron
So I have a category page which loads 100 + items. These items represent pages and I thought it would be a good idea to allow the use to type a page number into an input box and then go directly to that item/page.
The problem I have is the URLs are like so:
/item/5847-page-1
So the ID number could be anything which makes it impossible to code this. Is it possible to stop the ID from being generated for these items so it appears like so:
/item/page-1
That way I can generate a link from their input.
Many thanks
The problem I have is the URLs are like so:
/item/5847-page-1
So the ID number could be anything which makes it impossible to code this. Is it possible to stop the ID from being generated for these items so it appears like so:
/item/page-1
That way I can generate a link from their input.
Many thanks
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 3 months ago #136136
by Krikor Boghossian
Replied by Krikor Boghossian on topic Jump to item
You can use K2's advanced SEF settings to shape your URLs.
This setting is located under K2's parameters.
This setting is located under K2's parameters.
Please Log in or Create an account to join the conversation.
- Big Ron
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
10 years 3 months ago #136175
by Big Ron
Replied by Big Ron on topic Jump to item
Is this recommended though? I have just noticed that if you copy over an item and forget to delete the url alias it will generate the same URL as the copied item.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 3 months ago #136187
by Krikor Boghossian
Replied by Krikor Boghossian on topic Jump to item
If an ID is not present then you need to have different aliases so K2 can fetch the proper item. The same applies to categories.
Please Log in or Create an account to join the conversation.
- Big Ron
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
10 years 3 months ago #136214
by Big Ron
Replied by Big Ron on topic Jump to item
I thought so. Just for my own sanity ... is there a way to query the k2 database to see if any items do have the same alias? Im pretty sure that wont be the case but my site has hundreds of items and I wouldnt mind double checking.
Thanks
Thanks
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 3 months ago #136228
by Krikor Boghossian
Replied by Krikor Boghossian on topic Jump to item
You could try something like this snippets.khromov.se/check-if-column-in-mysql-table-has-duplicate-values/
or
stackoverflow.com/questions/688549/finding-duplicate-values-in-mysql
(table x_k2_items, column alias)
or
stackoverflow.com/questions/688549/finding-duplicate-values-in-mysql
(table x_k2_items, column alias)
Please Log in or Create an account to join the conversation.
- Big Ron
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
10 years 3 months ago #136274
by Big Ron
Replied by Big Ron on topic Jump to item
Thanks - very helpful.
Just one further question ... is there anyway to output the title alias in item.php ?
Just one further question ... is there anyway to output the title alias in item.php ?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 3 months ago #136312
by Krikor Boghossian
Replied by Krikor Boghossian on topic Jump to item
Try this snippet
<?php echo $this->item->alias; ?>
Please Log in or Create an account to join the conversation.
- Big Ron
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
10 years 3 months ago #136320
by Big Ron
Replied by Big Ron on topic Jump to item
Many thanks, Krikor
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 3 months ago #136325
by Krikor Boghossian
Replied by Krikor Boghossian on topic Jump to item
You 're welcome Ron.
Please Log in or Create an account to join the conversation.