The way to influence filtering Views through URL arguments is to use Contextual filters. For each URL sensitive Contextual filter you get one argument in your URL (separated by /
).
In your case you need to add a new Contextual Filter of type Content: Content type
and configure it:
When the filter value is NOT in the URL
Provide default value
Raw value from URL
Path component: 4
When the filter value IS in the URL or a default is provided
Specify validation criteria
Content type
Single ID
Case in path: Lowercase
More
Transform spaces to dashes in URL
Change the Path
of your Page from taxonomy/term/%
to taxonomy/term/%/%
.
Now when you visit taxonomy/term/1/article
it will list all articles tagged with the term 1 (I'm assuming you have cloned the default Taxonomy term Views).
Show term names instead of TID in URL
It is possible to pass term names to Views from URL, instead of using term ID numbers. So the URL might look something like: taxonomy/term/tag1/article
To achieve that we have to introduce the term name into Views. In this example we cloned the default Taxonomy term Views, and they only have term ID available.
To introduce more information about the taxonomy term we add a new Relationship. In this case we add Taxonomy term referenced from field_myvocabulary (use your Entity reference field referencing the term from the relavant vocabulary).
There are no consequences of this step visible from the outside, but from the inside we have more choices to choose from when adding new Contextual Filters. One of those new choices is Name from Taxonomy term Category. Add that as a new Contextual Filter and configure it:
Relationship: field_myvocabulary: Taxonomy term
Provide default value
Raw value from URL
Path component: 2
When the filter value IS in the URL or a default is provided
Specify validation criteria
Taxonomy term name
Vocabulary: My Vocabulary
Transform dashes in URL to spaces in term name filter values
More
Transform spaces to dashes in URL
Rearrange the Contextual filters to have that Name filter first, then the Content type second and you can ignore or remove the original "Has taxonomy term ID" in third place.
Now you can enter tag1/article
into the Preview and you'll see the results, all with using human-friendly URL bits. or visit /hub/tag1/article
on your site.
Relationships can introduce duplicate results. If this happens make sure your filters have turned on "Reduce duplicates" option, although you'll probably have to edit your Views Query settings and set them Distinct.
Be careful about the Case settings and converting spaces to dashes and vice versa. Your term name might be "Best term", and depending on your Contextual filters settings you might need to enter "best term" or "Best-term" etc.
The default Taxonomy term Views renders Taxonomy term in Views Header area. I haven't been able to make it work with the Taxonomy name though. It does work if you keep the ID as the third filter and use path tag1/article/1
.
But you can solve it (if you need this feature of rendered Taxonomy term in Views Header) with the help of an additional module: Views taxonomy term name into ID and the patch mentioned there.
You can also use this module to get term name in URL, instead of using a Relationship like explained above ;)