joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.76k stars 3.64k forks source link

Ability to select which Content types shown in tagged lists #12121

Closed ColinM2 closed 8 years ago

ColinM2 commented 8 years ago

Tags may appear in many standard Content items and Categories. Not only in 'regular' articles and categories but also in Newsfeeds, Contacts, Banners. Presently there are 13 content types and the majority of these may have Tags. Additionally there are Joomla! tags used by Components such as jDownloads.

It would be a useful and meaningful addition to the tags system if there was a function that specifies which content types should be included, or perhaps excluded, in the final list. This would be most useful in components or other extensions. Whilst the no action default would be all types this selectivity would add another dimension in the employment of tags to select related content.

Steps to reproduce the issue

This is just a suggestion. Apologies if in wrong place.

Expected result

Actual result

System information (as much as possible)

Additional comments

sovainfo commented 8 years ago

Both menu item types, Tagged items and Compact list of tagged items, already provide this. Could you be specific in where you would want this?

ColinM2 commented 8 years ago

Basically as a callable function so that an extension could set up a similar arrangement. As such a facility is already in the two menus I would assume most of the code is available.

brianteeman commented 8 years ago

Theyre not technicaly content types they are components. Content types has a specific meaning which is not correct here

ColinM2 commented 8 years ago

Please excuse the incorrect naming from this 'novice' - but I trust the intent got through.

Bakual commented 8 years ago

but I trust the intent got through.

I'm sorry, but I don't understand the request.

As said, com_tags supports to filter the tagged item list by content types already.

Do you want an extension to be able to filter their own items based on a tag? Imho that makes no sense as tags are meant to be cross-extension. There is an open PR https://github.com/joomla/joomla-cms/pull/10346 which tries to add such a filter to the article blog layout. If you read the PR, you can get a gist of my stance on it 😄

Can you further clarify if that is what you want?

ColinM2 commented 8 years ago

Thank you for the reference to #10346 where the intent seems to be to filter by specific tag names. This is not what I was suggesting.
Here the selection is by Component Type, much the same that is offered by menu items 'Compact list of tagged items' and 'Tagged Items'. These offer in field 'Content Type' a list of components that support tags, where the list comes from type_title in table "#__content_types". For example jDownloads has two specific types 'jDownloads Downloads' and 'jDownloads Categories'. Rather than using a menu item it would in many situations be helpful to users if the tags were filtered and listed by an extension, in our case probably the Component itself. In my view this adds a dimension to using tags.

Bakual commented 8 years ago

Correct me if I'm still wrong. You want to filter the tag view from com_tags like already possible with menu items, but without explicitely creating a menu item for it? Eg by having a link from JDownload which shows all tagged items from your extension? If so, that is already possible as well as the tag can be filtered by content types using an URL parameter. I haven't tried it but something along this way should work: &typesr=[jdownloads.category,jdownloads.item]. The code reading the URL param is this: https://github.com/joomla/joomla-cms/blob/staging/components/com_tags/models/tag.php#L187

ColinM2 commented 8 years ago

Been away and only took the phone which purposely does not have email setup! You have correctly identified the intent. I thought the code must exist but I had no idea where or what, So thank you for the steer. We will give it a try.

Bakual commented 8 years ago

I'm closing this for now. Please reopen if it doesn't work.