- Posts: 56
COMMUNITY FORUM
No commas between tags
- Matt
-
Topic Author
- Offline
- Senior Member
Less
More
13 years 5 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
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.
- roy storcken
-
- Offline
- New Member
Less
More
- Posts: 2
12 years 5 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
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.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 5 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
add "," into the line that echo's the individual tags
Please Log in or Create an account to join the conversation.
- Ralf Longwitz
-
- Offline
- Junior Member
Less
More
- Posts: 35
12 years 4 weeks ago - 12 years 4 weeks 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:
(inspired by stackoverflow.com/questions/1070244/how-to-determine-the-first-and-last-iteration-in-a-foreach-loop)
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
12 years 4 weeks 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
Please Log in or Create an account to join the conversation.