Timeline for 'Fuzzy' conditionals
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 19, 2013 at 11:30 | comment | added | Ian Young | No problem Dimitri. Providing the pieces of the puzzle and a starting point allows you to explore a little more and apply specifically to your problem. This actually seems like quite a common use case though so I may look to wrap this up into a plugin... | |
Apr 19, 2013 at 10:08 | comment | added | Dimitri Kouvdis | Sorted, see below. Thank you for putting me into a new perspective, I have poor php knowledge, but not proud for the time I have taken to do this :) When I have more rep points, I will add upmark your answers. | |
Apr 19, 2013 at 9:25 | comment | added | Dimitri Kouvdis | To match the category_id | |
Apr 19, 2013 at 9:12 | comment | added | Dimitri Kouvdis |
Sorry, I feel like I am not getting anywhere. The segment will have one or several values. Such as /5-6 or /5-9-11 or /4 (Just making it up). I need to find a way of getting it into an individual value to get a checkbox checked. {exp:channel:categories channel="items" category_group="3"} <input type="checkbox" name="categories[]" value="{category_id}" {if ??? == ??? }checked='checked'{/if} /> {category_name} <br /> {/exp:channel:categories}
|
|
Apr 19, 2013 at 8:35 | comment | added | Ian Young | The PHP way allows you to split them out and retrieve them individually as demonstrated. I just provided a sample of both as I wasn't exactly sure if you wanted an EITHER OR or just individual values. So the segment will always contain either one or two values? | |
Apr 19, 2013 at 7:33 | comment | added | Dimitri Kouvdis |
With your code above, that is what I am trying to do. {exp:channel:categories channel="items" category_group="3"} <input type="checkbox" name="categories[]" value="{category_id}" {if {category_id} == '{exp:stash:categories}' }checked='checked'{/if} /> {category_name} <br /> {/exp:channel:categories} '5' works but '6' is ignored
|
|
Apr 19, 2013 at 7:16 | comment | added | Dimitri Kouvdis |
Thanks for putting me into a new perspective, this is not really something I want. The segment value is currently '5|6', I need to have a conditional to act like a fuzzy manner, so my conditional should return like this segment_5 == '5' OR segment_5 == '6' Sorry I should have explained better
|
|
Apr 18, 2013 at 22:19 | history | answered | Ian Young | CC BY-SA 3.0 |