Search

There are quite a lot of extensions that can handle tags, but none of them seem to work the way I expect them to. I might be missing something completely obvious, so here is what I would like:

  • Dynamic creation of tags (deleting and editing would be nice, but not too important)
  • Existing tags selectable from a list in the publish page (preferably searchable - there are going to be many tags)
  • Sortable by popularity (to get a "most talked about" list)
  • Filterable by tag ("more articles that have this tag").

Have you ever had to handle something like this? How did you solve it?

Given what you're looking for, I'd suggest creating a separate section of Tags and use SBL+ to link to it.

Enhanced Tag List looks good, although you could probably use a normal Tag List field and apply something like the Chosen JS plugin to make it searchable.

I'd personally stick with a single field rather than the hassle of SBL and a separate section. A single field will make it much easier to aggregate your tags later without additional joins.

Sortable by popularity

Is this sorting the tags themselves (most used tags) or sorting the things that are being tagged? If the former, you can use a Section Schemas data source to find the most popular tags. Or a very basic custom DS.

Filterable by tag

The standard Tag List can do this: you'd create a data source that filters by the current tag, and filters out the currently-viewed item.

So my choice would be to use the most basic field (Symphony's own Tag List), customise the UI to taste, and use very simple custom DSs to get the output you might need.

use a normal Tag List field and apply something like the Chosen JS plugin to make it searchable.

This was my initial idea. But - and this might seem stupid - I can't find the taglist field anymore. What happened to it?

Is this sorting the tags themselves (most used tags) or sorting the things that are being tagged?

Yep, it's the tags themselves. How are the tags stored in the DB? From what I recall it's a csv list, right? Does that mean that finding the most popular tags has to be done in XSLT (or php)?

How are the tags stored in the DB? From what I recall it's a csv list, right? Does that mean that finding the most popular tags has to be done in XSLT (or php)?

Nope. Each tag in an entry gets a separate row in the table. Like the SB field. So you can find the most popular text via SQL, like

$tags = Symphony::Database()->fetch(sprintf(
    "SELECT DISTINCT(handle), COUNT(handle) AS count, value FROM `sym_entries_data_%s` GROUP BY handle ORDER BY value ASC",
    $tag_list_id
));

and iterate over the $tags to build the XML.

This was my initial idea. But - and this might seem stupid - I can't find the taglist field anymore. What happened to it?

Hm. It shoul be there. What version are you running?

Each tag in an entry gets a separate row in the table. Like the SB field.

Great!

It shoul be there. What version are you running?

2.3

edit: can not find it in the extension list, either

It's a core field, not a core extension. So it should be in /symphony/lib/toolkit/fields/field.taglist.php.

DOH! Ok, I feel stupid now. Thanks :)

So can you add a Tag List field to your sections? It sounded that it's not available in the list of fields.

Yes, I can. I was looking for the field class itself, because I wanted to extend it with my own UI. Needless to say I was looking in the wrong place.

For the interested, I've made a quick extension which adds the Select2 library to the tag list field.

Thanks for sharing!

Don't you think that you look fat on your new gravatar picture?

That's a bit mean.

Yeah, and that's also the reason why you don't see anything but boots on my gravatar picture.

:-))

Nah. Such a nice community we have...

my gravatar picture.

Michael, even your picture is getting old ;-)

Yes, but on my picture you can't see how fat I am.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details