INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Filter custom content type by taxonomy w/correct template

Filter custom content type by taxonomy w/correct template

Filter custom content type by taxonomy w/correct template

(OP)
This should be really simple but it escapes me.

I have a custom content type - portfolio
I created a taxonomy - ptype (Portfolio Types)

I already have a portfolio template that displays post of content type portfolio

Now I want to add a filter on the top of the page that will link to a specific set of post by category

ALL - WEB DESIGN - MARKETING - HOSTING (for example)

The slugs for the terms work for example if I use example.com/portfolio_category/web-design it loads the page but with the wrong template not the portfolio-template.

Can someone please tell me how to tie this all together?

Thanks in advance!

"You can have anything in life you want if you help enough people get what they want"
Zig Ziggler

RE: Filter custom content type by taxonomy w/correct template

assuming you mean custom post type by the phrase 'content type'), then the template for the post type should be named

CODE

archive-portfolio.php

single post pages should be named

CODE

single-portfolio.php

from your post above, it seems that you may be mixing the category taxonomy with the ptype taxonomy.  i'm not sure what the purpose of the custom taxonomy would, in that case.  

if you want to force a particular category page to a template then name the template

CODE

category-SLUG.php

but if you are navigating by the custom taxonomy then instead name the template

CODE

taxonomy-ptype.php

this page might be useful.  likewise i have always found this image to be useful too


 

RE: Filter custom content type by taxonomy w/correct template

(OP)
jpadie,

Thanks for the response!  I will need some time to filter through this great information.  I am still struggling with some of these concepts and even though I have spent HOURS on this today I want to do my due diligence with your answers.  

Quick answers to some of your questions:

Yes I meant post type (content type is drupal, my bad)

I shouldn't have used the word "category" in describing my desire to filter by my new taxonomy "ptype" - Portfolio Types.

I was able to sort out the single-portfolio.php template and it works.  Having an issue getting it to display the taxonomy term...  but not my biggest issue right now.

The rest I will continue to research... thanks again for your prompt and detailed response!

Craig  

"You can have anything in life you want if you help enough people get what they want"
Zig Ziggler

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close