1

I can't seem to get my tags to filter the way I intended them to work. What I'm trying to do:

I have a vocabulary created via the tags field attached to the articles content type.

I have a content type Foo which I'm creating a view in to list 'Articles' with the tag corresponding to Foo's title

Ex: Article Type: 1 - Tag: 'Yay You' 2- Tag: 'Yay Me'

Foo Type 1 - Title: 'Yay You'

would have a view showing data from Article 'Yay You'

I've already tried every conceivable way to apply contextual filters to this but can't seem to get it to pull any data unless I remove all contextual filters so that it's just showing my teasers of Articles.

The one I spent a large chunk of time on that seemed promising was the tag/taxonomy term filters attempting to pull the taxonomy term from the url since it's in the format site.com/articles/hyphenated-article-title but that didn't end up getting me anywhere.

2 Answers 2

0

I think in your logical data structure your second content type "Foo" is not really a content type, but a taxonomy term, as the identical title "Yay You" suggests. The taxonomy terms are fieldable and you can fill them with content the same way as any entity. So you don't need the second content type. To show the taxonomy term you can use the default view for taxonomy:

/admin/structure/views/view/taxonomy_term

To modify the diplay to show the new fields:

/admin/structure/taxonomy/manage/tags/overview/display/full
2
  • To break it down to my actual scenario, I have a Games Type along with the default Article Type is what they are. So on a Games page I have a set of information followed by a 'news feed' that is a views of the article type where the article type has a tag field. So what I'm trying to do is use the title of the games page to cross reference to the tags on and article
    – gcalex5
    Dec 16, 2015 at 14:57
  • In your scenario Games Type is not a content type, but a taxonomy term and the name of the term is your title. For your content this makes no difference, you can put in the taxonomy term "Games Type" as many fields as you need. And then you can design the landing page of the term as you like.
    – 4uk4
    Dec 16, 2015 at 17:03
0

If you really want Foo to be a content type - presumably so you can add extra information to each Foo page, beyond the listing of Articles with tags that match the Foo title - then consider the Viewfield module which has a preliminary D8 port.

This will enable you to

  • create a field on Foo that references a particular view

  • set a default argument using Foo's title by token, which is passed through to the view and can be used as a contextual filter in the view

  • optionally choose to "force the default" so that users with permission to edit Foo cannot necessarily change the reference and arguments to this view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.