URL exceptions & variable meta fields dependent on chosen taxonomy

Hello all, I am relatively new to Sage 9. I’ve been lurking the forums for a few months, soaking up ideas and have currently only built 1 production site with Sage, but I have been experimenting a lot to make everything “click”.

Anyways, I have some pretty large projects approaching and want to build them with Sage. I have general direction, but just curious about 2 things and wondering if the community can shed some insight:

  1. I am building out a product catalogue for the site to be built around. I am creating a CPT using Models and sprinkling in some extra options with Extended-CPT. I have a custom taxonomy for “Product Type” (category), then another custom taxonomy for “Brand” tags. Basically, my desired flow is: Products > Product Type > Brand > Singular product. Each item in flow should have its own template. Using Extended CPTs, I was able to get my permalink structure down. My question is how to handle the exceptions? Every product will have a Product Type, but not a brand. Currently, when I add a product with no brand tag checked, it will replace the /brand-name/ URL slug with the cpt name of /products/. This leads to the URLs looking like /product-type/products/product-name. Which hurts my feelings. How would you guys handle something like this in Sage?

  2. I need to have my post (product) display different meta fields depending on the chosen taxonomy (product type). I have accomplished this with CMB2 in the past, however, the post needed to published with the taxonomy selected first, before the fields would show up. I would like to have this automatically change via ajax as the taxonomy is selected, instead of having to refresh.

I am open to any and all suggestions you guys might have. Also, if there are other super awesome tools or libraries you cant live without, I’d love to gear about them! Sage is a godsend. I cant wait to use it to its full potential. Using Models and Extended-CPTs with Sage makes it even better. I am sure there is other awesomeness i am missing out on.


Hey @Matthew_Scheppmann - I’m glad you’re enjoying using Sage!

These are pretty general (non-Sagey) questions, so you may have better luck finding answers elsewhere online, but here’s a quick thought on your first question: you could see if you can use the Rewrite API or Cortex to further customize your permalinks, or you could use a generic brand tag when you don’t have an actual brand for a product.

For the second one, you may be able to find out if there are ways to accomplish what you want with CMB2 by looking directly at their resources or asking over there.

Good luck!

Thanks for writing back! You are absolutely correct, I kinda wrote the post feeling some desperation set it… hehe. I have been working on it and think I was able to answer my own questions.

I appreciate you sending over Cortex, too. These are the types of plugins I am looking for. Would you guys happen to know the best way to find more plugins I can include with composer? Perhaps a member has built a comprehensive list of nifty plugins outside of the forums? Things like models/controller/carbon fields… they are changing the game for me :slight_smile:

Again, sorry for how generalized my questions sound… I am just excited for anything that could help improve my workflow and efficiency. :man_dancing:

1 Like

No problem at all! Glad you were able to get things worked out.

TBH I don’t know of a centralized source–I basically find out about them by hanging around the other Roots people here and on Slack, because they’re all smarter than me. But yeah, generally getting plugged into a developer community on some kind of social platform so you can benefit from the knowledge of that network.

Another option might just be to browse some of the WordPress-related packages on Packagist.

I feel like @Log1x probably has at least a mental list of some cool stuff.