Questions tagged [tags]

Tags are folksonomies for your entries, users, and assets.

Filter by
Sorted by
Tagged with
12
votes
4answers
19k views

Removing whitespace from {{ tag.name }}

I'm using tags to do some Javascripting. Is there any way that I can tell Craft to remove whitespace from {{ tag.name }} if the tag.name has spaces (for example 'apples and carrots'), and add dashes (...
11
votes
2answers
1k views

How can I create a visually weighted tag cloud?

I kind of want a tag archive page where it doesn't just list all the tags and links to entries based on that tag, but where the sizes of the actual tag link vary based on frequency of use. Any idea ...
11
votes
4answers
1k views

How do I delete a tag?

Where in the Craft Control Panel can I globally delete a tag? Not from a specific entry, but completely out of the system.
10
votes
3answers
1k views

Order tags by count - e.g. Top 10 Tags Used

I would like to have a Top 10 Tags list in descending order. I'm able to list and limit 10 tags used, but the order parameters are limited to name, group, and date essentially.
9
votes
1answer
528 views

How can I best extend TagModel to add a `count` property?

I'm attempting to write a plugin to extend tags by adding a count property that'd be useful identifying popular tags, making a tag cloud, and anything else where a count would be useful. The Goal ...
8
votes
4answers
6k views

Remove the last comma in an inline list of tags?

In a list of tags I'd like to remove the last comma. So is there something that works like the Ee backspace parameter?
7
votes
3answers
1k views

How do I display tags comma separated with “and” between the last two tags?

I would like to output a tag-list like this: foo, bar and baz I know how to elegantly output a tag list with no comma after the last tag: {% for tag in tags %} {{ tag }}{{ not loop.last ? ', ' ...
6
votes
2answers
206 views

Show a list of recently used tags only from the current locale

I'm having trouble outputting a list of tags that only includes tags from the current locale. Here's the setup: I have a site with two locales: english and spanish I have a section with handle ...
6
votes
1answer
112 views

How can I restrict tags that are able to be used?

Just downloaded and am setting up Craft. Super excited! I would like to know the following: At the moment, I am assigning tags to entries in the hopes of using them as an organizational/navigation ...
5
votes
3answers
2k views

Search for related entries based on tags

On an entry page I search for related entries based on the tags assigned to the respective entry. The following example works: {% set tags = entry.q_tags.first %} {% for tag in entry.q_tags.offset(1)...
5
votes
2answers
1k views

Get the Category name into the URL for an entry

I have a gallery which is categorised. The gallery is a Structure section where the user adds an entry and then assigns it to a category - all good. At the moment, when clicking on an entry title the ...
4
votes
4answers
2k views

Looking to use a tag slug/URI and loop through entries of that tag

It doesn't appear that tags are handled the same way as categories in the sense that categories have a slug (which results to a URI). I'd like to use tags to link to a "tag" page, similar to a ...
4
votes
2answers
395 views

How to delete tags in Craft CMS 3

I want to delete some of the tags that are entered in the system. Since there is no way to do that in Control Panel, and there is not a valid plugin that can do this (know that from my previous ...
4
votes
1answer
692 views

Deleting unused tags

Tags are used to categorize blog post topics. How can I delete or manage unused tags? For example, one user created a "Success Factors" tag and another created a "SAP SuccessFactors" tag. The goal ...
4
votes
2answers
247 views

Most related articles

I am using the normal relatedTo property to find related articles, but I have an issue which is: craft.entries.section('section').relatedTo("tags").id('not ' ~ entry.id).limit(3) Lets say THIS ...
4
votes
1answer
139 views

Display related entries across different entry types using tags in different tag groups?

I'm working on a site that has two different entry types (e.g., "blog" and "photos"), and each type has it's own tag group. When viewing a particular entry, I'd like to display related entries found ...
4
votes
1answer
97 views

Bullet-proofing tags with punctuation

I have a route set up with a tag: news/tag/[tag] => news/_tag How do I generate urls that will match that route for all possible tags (including tags with punctuation)? How do I resolve that url ...
4
votes
1answer
98 views

Sort entries by best match to multiple categories

I've got a channel where entries will be tagged with multiple categories. I want to use those categories to show related content for each entry. So if an entry has cat_a, cat_b and cat_c, I want to ...
4
votes
1answer
242 views

Limit search results for users by tag (and limit to 5 tags)

I've read as many forum posts and documentation but am a little stumped over a specific use-case. Currently the search page grabs the url segment, loops through a verified user group, and uses the ....
4
votes
2answers
298 views

Is it possible to order related entries by relevance of tags?

I have a set of entries which each have 0 or more tags (no limit). For each entry, I am aiming to display 3 'related entries', related by the tags field. e.g. If entry 1 is tagged with 'apples', '...
4
votes
1answer
703 views

Custom Twig Tags

I'm working on a site with a very complex permissions structure (based on groups, dates, dynamic overrides etc). I've written a custom permissions plugin to handle this in a centralized fashion. In ...
4
votes
1answer
908 views

How to add a tags-field to an entry form?

I use the following entry form (front-end): https://craftcms.com/docs/templating/entry-form How can I add a tags-field to this entry form?
3
votes
1answer
331 views

How do I add a value to a tag field type using the entries service saveEntry method?

I am updating an entry using the entries service, I want to add a tag value into a tag field type (classifiedTags). $entry = craft()->entries->getEntryById(120); $entry->getContent()->...
3
votes
2answers
973 views

List entries for a single tag from blog section

I want to get a list of entries in a template that have one specific tag 'weddings' and exclude entries that do not have this tag. {% set tag = craft.tags.search('weddings').first() %} {% if tag %} ...
3
votes
1answer
810 views

How do I make the “%20” in URL's show as “-”

I'm building a site where I am linking entries based on their tags. If you click on a tag you go to a dedicated page with all entries that share the same tag. {% for tag in craft.tags.relatedTo(entry)...
3
votes
1answer
440 views

How do I display an entry's tag?

I want to display an entry's tag next its title in a list of entries, and on the entry's detail page. For example, for a blog. How do I do that?
3
votes
1answer
2k views

Query Entries by Tag

I want to only show entries that match a specific tag. I'm trying to do something like: {% paginate craft.entries.section('blog').relatedTo('tagName').order('score') as entriesOnPage %} This doesn't ...
3
votes
1answer
112 views

.relatedTo() not returning tags with spaces

I think I'm seeing a bug while using advanced search with relatedTo(). If I use a simple search, like this: {% set param = { order: 'RAND()', limit: null, search: "#{request.tags}" } %} It ...
3
votes
1answer
179 views

Where are tags stored in the database?

Seeing as there currently isn't a way of deleting / managing tags in Craft3, I was wondering if someone could point me to where in the database these tags are stored so I can delete them manually. ...
3
votes
1answer
146 views

Tag relations not saving

Hello kind helper folk, I'm working with Simple Craft XML Import, which has a handful of older code in it. I've managed to get through most of it to the very end. The last thing it does is saves ...
3
votes
1answer
125 views

Difference between {% includeCssFile %} or including it with <link>

I go a simple question. I wanted to start with building my craft template from html and changed all css and tags to to equivalent {% includeCssFile %} or {% includeJsFile %}. The page was working ...
3
votes
1answer
710 views

How do you add tags to tag field when saving an entry?

I'm working on a custom import plugin which needs to import a load of content to fields including categories and tags. Categories is working fine using a comma separated list of category ids: ...
2
votes
3answers
329 views

Should I use tags for cities?

I would like to have some advise on the following: I'll be running a site with events. These events (channel entries) will take place in a certain city. I don't want to setup every city as a category,...
2
votes
2answers
250 views

How do you rename a tag globally in the Craft Control Panel?

Is there a way to rename a tag, globally, within the Craft CP? If not directly, would the Find and Replace tool include tags?
2
votes
2answers
294 views

Still not able to manage tags in Craft 3?

I have page where I display some items and there are filters by tag. So I make a list of all tags that are created. Then when the user click on some of the tag, he see only the product with that tag. ...
2
votes
1answer
229 views

How can I group a list of tags into ranges of first letters (A–E, F–J, etc.)?

I'd like to be able to fetch a list of tags from a blog section and then group them into ranges of letters. I've used this code to fetch and group a list of tags by first letter: {% set entries = ...
2
votes
2answers
1k views

How can I use tag slugs in URLs?

This question is a summary of my working with tags yesterday, I'm posting my findings to SE so other people can benefit. For the purposes of this question, I'm going to be using a tag with the title '...
2
votes
3answers
687 views

Nested Matrix functionality for one block type using Tags

I have an entry with two matrix fields and I want to use relations between them using Tags to create a fake nested Matrix functionality for one block type. The "main" matrix field is for creating a ...
2
votes
1answer
147 views

How to build a sentence based on tags

I try to build a complete sentence based on tags as follows: This is a sentence with tag1, tag2 and tag3. My code is: {% set topics = entry.topics.first %} {% for topic in entry.topics.offset(1) %}...
2
votes
2answers
411 views

Create a route to display entries with multiple tags

I understand how to set up a route and template that allows me to display entries by tag. But how can I set up a template + route to grab multiple tags (if supplied but could just be one) from the ...
2
votes
1answer
453 views

Plugin: Tags field for front-end Entry Form

I would like to add tags via a front-end entry form - not like here, but as follows: Text field in a front-end entry form where user add tags (separated by commas). After pressing the save button, ...
2
votes
2answers
449 views

Globals (template tags) in entries?

Is it possible to use template tags within an entry? Specifically, I'd like to use Globals I've set up within an entry, so I can manage a brand name globally.
2
votes
1answer
535 views

How do I list the tag groups that are actually in use?

I'm developing a masonry photo gallery with some filters (colors, style, manufacturer, etc) and I want to use tags to filter them by. I need some navigation which should look like this: <ul> ...
2
votes
1answer
1k views

Show tags for each entry

I have one tag for each entry. - Entry1 Tag1 - Entry2 Tag2 Now I want to show them in the title of each entry. But it doesn't work. {% for entry in craft.entries.section('mainEntry')....
2
votes
2answers
308 views

Sharing a template with identical category and tag name

I'm trying to stay as DRY as possible here and sharing one template for a news list view; all, category and tag all sharing the same template (and trying to refrain from having a category or tag ...
2
votes
1answer
83 views

How to check name of a tag

Per documentation I am getting a selected tag: {% set tag = entry.myTagsField.first() %} How to check if its name is equal to "Flower"?
2
votes
1answer
195 views

List entries without specific tag

I am trying to output a list of entries from a channel section that DO NOT have a certain tag. I am able to output the entries that have the tag assigned by setting the tag as a variable and using ...
2
votes
1answer
144 views

Best method to handle %20 in tag URLs with multiple words

On my page of all tags, it works great except for tags that have more than one word. The URL is replacing the spaces with %20 as one would expect. http://www.colorcomputergames.com/tags/ I tried ...
2
votes
1answer
234 views

Tag overview in the Craft backend

Is there a possibility or plugin that I can see all my tags that I am using on my Craft page? So that I can edit the tags when I, for example, wrote some tags wrong or just want to delete some and so ...
2
votes
2answers
532 views

Find Related Entries with Identical Tags

I'm trying to show related entries for a single item. I want to look up a specific tag(s), and search for any entries that share the same tag(s) then display those related items. I've read through ...