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 Answers
You may also consider using Switchee
-
Wow, I hadn’t even considered that Switchee also does RegEx. That’s handy indeed! Jan 14, 2013 at 16:53
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.
-
-
If you want some more help with the regex - let me know and I'll look tomorrow when I'm at my desk Jan 13, 2013 at 21:18