Keyword

No commas between tags

  • Matt
  • Matt's Avatar Topic Author
  • Offline
  • Senior Member
More
12 years 9 months ago #60640 by Matt
No commas between tags was created by Matt
Hi,

when I put tags to articles there is no comma between the tags. What do I need to do to have commas seperating tags like in this article: getk2.org/blog/item/303-k2-v254-maintenance-release-now-available ?
Using latest k2 and j1.7.3

Thanks

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

More
11 years 10 months ago #60641 by roy storcken
Replied by roy storcken on topic Re: No commas between tags
Hi Matt,

Have you found a solution yet?
I also want comma's between the tags or to have a tagimage as a background.

kind regards,
Roy

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

More
11 years 10 months ago #60642 by william white
Replied by william white on topic Re: No commas between tags
Search your item.php for <!-- Item tags -->
add "," into the line that echo's the individual tags

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

More
11 years 5 months ago - 11 years 5 months ago #60643 by Ralf Longwitz
Replied by Ralf Longwitz on topic Re: No commas between tags
Me too, I like to have it that way. Is there hope you're going to add this as an option?

Just adding commas will also add one to the last item.

My code now looks like this:
<?php foreach ($this->item->tags as $key => $tag): ?>
 <li>
  <a href="<?php echo $tag->link; ?>">
   <?php echo $tag->name.(($key === key($this->item->tags))?'':', '); ?>
  </a>
 </li>
<?php endforeach; ?>

(inspired by stackoverflow.com/questions/1070244/how-to-determine-the-first-and-last-iteration-in-a-foreach-loop)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 5 months ago #60644 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: No commas between tags
You can use CSS content value and the :after, last:child pseudo-selectors to achieve this 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