Questions tagged [tags]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
2k views

Category vs Tag

Is there a fundamental difference between a Craft Category and a Tag? I originally set up a site using Tags before the Category feature was available and now I'm adding a new section and trying to ...
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 (...
1
vote
1answer
38 views

How do I add an H2 tag to a page?

How do I add an H2 tag to a page? The site already runs many months now. All pages are okay but some are lacking an h2 tag. Is there a simple way to add an h2 tag to these pages?
1
vote
1answer
94 views

Fetch Entries with Tags Only

I'm trying to get all the entries which have tags associated with them. At the moment I'm doing: $entries = Entry::find()->with('tags')->all(); and then filtering the results in PHP as ...
1
vote
1answer
36 views

Display entries by tag

I've read through the docs but can't figure out what I'm doing wrong here: I'd like to display a list of entries by tag, where the tag is in segment 2 of the url. Here's what I've tried and is not ...
1
vote
2answers
38 views

Craft Query by Category and Tag

I am trying to find the last four Channel entries (Named: Post) with a Category relatedTo "Support" (id: 458) AND Tag relatedTo: "Widget1" (id: 469) I've had success using Category or Tag but not both:...
1
vote
0answers
48 views

get tags related to entry

I'm working on Craft plugin which should find entries with special tags. In my action I have a string: $entries = Entry::find()->section('Projects')->type(['Projects']); and it returns all ...
0
votes
0answers
11 views

Can I link to a tag from Redactor?

Title says it all. I have tags that I use to relate entries to each other. When typing inside a Redactor field I would like to be able to write something like #engineering and have that tag become a ...
0
votes
0answers
11 views

filter tags by level

I have a tag field in a section. We'd like to filter the tags in a tag cloud according to what level they are in - so all the children or siblings of the current entry will show up, but not all tags. ...
1
vote
1answer
98 views

Filter entries by tags

Still very new to Craft but just can't figure this problem out, it's a level above me at the moment. I have an FAQ page as a 'single' that I would like to display all entries from a channel by ...
1
vote
1answer
225 views

Product Filtering with Tags

I've built a product filtering system using tags and currently have 2 available tag groups under different fields. Size and Type Currently if I select 1 tag from both size and type, it shows all ...
2
votes
1answer
224 views

Quick check to see if tag exists?

Just wondered if there's a quick way to see if a specific tag exists from anywhere in the site (by ID)? I'm creating a navigation bar, and need to include a specific tag... only if it has been ...
0
votes
1answer
66 views

How to add tags in craft CMS 3

This is my first template that im working on in craft cms3, i've managed to make the most of the homepage and other tabs of website dynamic using the CMS, but I can't figure out how do I make tags and ...
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 ? ', ' ...
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 ...
1
vote
2answers
163 views

Filtering by categories AND tags with full match

We're trying to filter by categories AND tags in the one form. However can't seem to get things working as we would like. Essentially, we have a form that pulls in the tags and allows multiple ...
2
votes
2answers
279 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. ...
4
votes
2answers
359 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 ...
2
votes
2answers
214 views

How do I hide tags in a category that have no entries?

Entries can have one of two categories and one tag. (People = entries | program = categories | year = tag) On the pages I'd like to display entries related to the category and grouped by tag. ...
1
vote
1answer
13 views

Editing a tag not reflecting on all records.. kindof

We have hundreds of entries with the improperly spelled tag "accessibilty" (the third i is missing). A search for "accessibility" will not find them (spelled correctly). I edited the tag on a record ...
0
votes
1answer
75 views

I would like to implement the remarketing tag into my website

I was wondering if anybody can help me with the implementation of the remarketing tag into my site. I have the codes and I just don't know where to enter them.
2
votes
1answer
126 views

Add Tags to a Newly Created Entry With PHP in Craft 3

I am able to successfully create new entries with PHP when I am using basic field values that are Rich Text or Plain Text fields, but am unsure how to add Tags to an entry. So my entry already has a ...
3
votes
1answer
170 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. ...
2
votes
2answers
237 views

How to set multiple 'active' classes from query string

I'm outputting all tags that are in use and then allowing the user to click these build up a query string to filter and display the results. It's all working fine. Except, I'm having difficulty ...
0
votes
1answer
40 views

My `for` loop has fallen…and it can't get up

I want my <ul> to show a single tag representing all "active" entries ( "active" using a custom lightswitch field in the entry: fellowStatus. Each tag is a year (e.g. 2014, 2010, etc) E.g. if ...
1
vote
1answer
373 views

SEO titles/descriptions for tags and archive pages

I have a blog setup with a Categories, Archive and Tags. In my _layout template I've been using the following to pull in SEO titles from fields, or Page/Category Titles is that's not been defined. {%...
1
vote
1answer
69 views

Ajax - Create tag with custom ID programatically

I'm trying to create an jQuery/Ajax script to import data from a Wordpress API service and want to import the WP tags into my database. Everything works as expected when I loop through the data and ...
1
vote
1answer
271 views

How can I add programmatically a Tag after SAVE_ON event in case of Assets types

We have to update the Asset after the SAVE_ON event, and the Craft::$app->elements->saveElement($asset); Not seems to be working (it is getting timed out). So what is the best pratice to ...
1
vote
2answers
584 views

Help with tags input field on a front-end entry form

I need to make a "keywords" field on a front-end entry form that can create tags in the cms (Craft 2). I am fully aware of existing tickets regarding this issue like Brandon Kelly's but they're a ...
1
vote
1answer
226 views

Get Entries That Match ALL of the tags specified

I have a search page where a user can check about 20 different checkboxes, where these checkboxes all relate to tags I have set up inside of Craft. I would like to perform the following search query: ...
1
vote
1answer
47 views

Tag Localization: how to create a tag without translation fallback version?

I'm dealing with tag localization on an English/Spanish site and have figured out that if I create a new tag, both En and Es elements are created by default, which would be O.K. if I never had to ...
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 ...
1
vote
1answer
76 views

Save an entry with tags

I have a project that the user choose a tag (tags are already created) and save the information. I try save a entry which has a tag field, all the stuff saves, but the tags don't. I try search ...
2
votes
1answer
67 views

Multiple Tag Groups/Sets for separate channels

I have two separate channel types, let's say "News" and "Reviews" and each of those can have tags. Is it possible to have separate tags for each of those? So News has it's own set of tags, that can't ...
1
vote
1answer
43 views

Search for non-existing tags shows all entries

I have 3 groups of tags that redirect to the same template. tags/index.html. All the routing and linking those tags to their group page works well. <a href="{{ siteUrl }}taggroup/{{ tag.slug }}" ...
2
votes
1answer
528 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> ...
1
vote
1answer
48 views

Trying to set a default asset folder using Craft tags

I'm trying to set a default asset folder for a field, as per the Craft docs on Dynamic Subfolder Paths. I'm trying to set the asset path for each blog article to be /our-journal/{date}/{slug}, where ...
1
vote
1answer
231 views

How to get a proper tag Url

I use the code "Link to the Tag URLs" from the following article: https://craftcms.com/support/tag-urls {% if entry.tags | length %} <h3>This entry is tagged with:</h3> <ul> {% ...
4
votes
1answer
900 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?
4
votes
1answer
95 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 ...
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.
3
votes
1answer
122 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 ...
1
vote
1answer
224 views

Get random entry tagged with

Looking to get a random entry from my database which is tagged with 'featured', is this possible at all? I've seen randomised by just the entry loop but nothing else.
1
vote
1answer
96 views

How do I add the Categories and tags related to each entry?

This is my basic entry layout and I just want to display the linked category and tag names as indicated… <div class="posts sidemeta"> {% for entry in craft.entries.section('news').find() %} <...
1
vote
1answer
44 views

Craft ordering tags by 'name'

I've got a problem with some tasks. Craft tells me 'Deleting Stale Template Caches Failed' multiple times. When I look in the Deprecated Warnings, it tells me two things: Ordering tags by ‘name’ has ...
1
vote
1answer
290 views

How do I retrieve tags and tag data for an entry in Element API?

In Element API v1, I am setting up an endpoint that is trying to expose a news entry including the tags (title, id, slug) associated with it. Thought it could be set up similarly to how you can ...
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.
1
vote
0answers
55 views

Plugins for Tags

Is there any plugin for Tag that will be like: Text field in a front-end entry form where user can add multiple tags. After pressing the save button, the plugin should: check for every tag, whether ...
1
vote
1answer
24 views

Can I move existing tags, which are currently in a global tag group, to new the new tag groups I've set up?

I've set up new tag groups to help organise the c300b tags we have set up. How do I move the existing tags, which are already in use, to the new tag groups?
2
votes
2answers
982 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 '...