Keyword

Category view - anchor link to item

  • 010101
  • 010101's Avatar Topic Author
  • Offline
  • New Member
More
13 years 8 months ago #93068 by 010101
Category view - anchor link to item was created by 010101
Does anybody know of a way to link to a particular item in a category listing using its ID? I don't want to open the article, I just want the link to 'find it' within the category listing.

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

More
13 years 8 months ago #93069 by BBC
Replied by BBC on topic Category view - anchor link to item
You need to be more clear. You want listing in category view, but don´t want Title and image to lead to detailed Item (open Article) ?

 

If it is so, you have for that already options in parameters for Category.

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

  • 010101
  • 010101's Avatar Topic Author
  • Offline
  • New Member
More
13 years 8 months ago #93070 by 010101
Replied by 010101 on topic Category view - anchor link to item
Sorry, I do need to be more clear. I have a long list of articles in category view, with titles, intro texts, whatnot. I'm trying to create a link that leads to a certain item in that list without actually opening it, like an anchor link.

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

More
13 years 8 months ago #93071 by Terry Britton
Replied by Terry Britton on topic Category view - anchor link to item
Add the following in category_item.php right after <!-- Item title -->. You can then link to it with the word anchor followed by the item id (for example anchor16). Or you can leave out the word anchor if you want to and just link to the item id.

 

<a name="anchor<?php echo $this->item->id ; ?>">

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

  • 010101
  • 010101's Avatar Topic Author
  • Offline
  • New Member
More
13 years 8 months ago #93072 by 010101
Replied by 010101 on topic Category view - anchor link to item
That's exactly what I need! Except, I'm having trouble forming the link.

 

My category listing URL looks like this: index.php?option=com_k2&view=itemlist&task=category&id=xx

I tried adding the item id, both with and without # (I think that's required for anchor links?) but no luck. The link takes me to the category list, but not to the item.

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

  • 010101
  • 010101's Avatar Topic Author
  • Offline
  • New Member
More
13 years 8 months ago #93073 by 010101
Replied by 010101 on topic Category view - anchor link to item
Sorry, my fault, I added the code to the wrong file. I needed to add it to the file in templates/my_template/html/com_k2/templates/default/ and not to the one in /components/com_k2/templates/default/

 

I always get those mixed up...

 

And the link does need the #.

 

Thanks for the solution, Terry!

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

More
13 years 8 months ago #93074 by BBC
Replied by BBC on topic Category view - anchor link to item
Please....what is this ? Word anchor ??!! Where do you put this for an Item ?

Terry A Britton said:
 You can then link to it with the word anchor followed by the item id (for example anchor16). Or you can leave out the word anchor if you want to and just link to the item id.

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

  • 010101
  • 010101's Avatar Topic Author
  • Offline
  • New Member
More
13 years 7 months ago #93075 by 010101
Replied by 010101 on topic Category view - anchor link to item
... with the word "anchor", followed by ...

BBC said:
Please....what is this ? Word anchor ??!! Where do you put this for an Item ?
Terry A Britton said:
 You can then link to it with the word anchor followed by the item id (for example anchor16). Or you can leave out the word anchor if you want to and just link to the item id.

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


Powered by Kunena Forum