Is there a way to check if ANY url segment matches a value?
I know we have {segment_1-9} and {last_segment} available, but what if you want check for a value that could be present in any of the nine available segments.
Thanks.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
October 27, 2011 3:15pm
Subscribe [3]#1 / Oct 27, 2011 3:15pm
Is there a way to check if ANY url segment matches a value?
I know we have {segment_1-9} and {last_segment} available, but what if you want check for a value that could be present in any of the nine available segments.
Thanks.
#2 / Oct 27, 2011 4:25pm
I would suggest using the Freebie add-on (http://devot-ee.com/add-ons/freebie).
I copied the relevant documentation
——
Want to trigger “print” behavior no matter WHERE the /print/ segment is added? The {exp:freebie:any name=“segment_name”} tag will return either “true” or “false” when it matches any segment with the supplied name. This allows you to throw useful segments on the end of all your URIs without worrying about their position.
#3 / Oct 27, 2011 4:32pm
Perfect, Thank you. I’ll check it out.
#4 / Oct 28, 2011 1:30am
Thanks mz91184. I’m gonna move this tot he Community Support forum in case you have any follow up questions for mz91184, Bryan