1

The issue I’m coming up against is that a client’s site has a series of nested units, tasks and segments, and they want different conditionals run depending on the various segments. Now, I could use the url_title to find each url segment’s channel, but that seems like I’d potentially have too much overhead. What I’d really like to do is use the channel preferences to prefix each url_title with the channel name, and then in my conditional, query the segment in order to run various templates/changes/etc. Is there any decent way to accomplish this, or is this adding too much overhead, still?

2

You may also consider using Switchee

| improve this answer | |
  • Wow, I hadn’t even considered that Switchee also does RegEx. That’s handy indeed! – Christopher Kennedy Jan 14 '13 at 16:53
2

If you search for SurgerEE on devotee - you'll be able to use that to query based on regular expression.

https://github.com/dsurgeons/SurgerEE/wiki/String is the function. I've used it lots of times and to really useful.

Sorry for the brevity - on the iPad and mobile at the mo.

| improve this answer | |
  • Not a problem! This is a great option, for sure. – Christopher Kennedy Jan 13 '13 at 21:11
  • If you want some more help with the regex - let me know and I'll look tomorrow when I'm at my desk – madebyhippo Jan 13 '13 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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