I have multiple, various elseif conditions that have the same value, is there a way to condense all the conditions to one string that all have their common value?
I have looked all over for an example but only find very complicated, unrelated discussions.
Example:
{% elseif "aerospace" in BlogUrl %}
<a href="url.com/blog_subject_one_subscribe">
{% elseif "aviation" in BlogUrl %}
<a href="url.com/blog_subject_one_subscribe">
{% elseif "aircraft" in BlogUrl %}
<a href="url.com/blog_subject_one_subscribe">
{% elseif "jet-engine" in BlogUrl %}
<a href="url.com/blog_subject_one_subscribe">
{% elseif "fuel-systems" in BlogUrl %}
<a href="url.com/blog_subject_one_subscribe">
This is for an Oracle/Compendium blog categories subscription management workflow. As you can see, multiple categories have one common subscription url.
I'm new to PHP, is there a way to group all the conditions giving them all the common value of the URL in one string, instead of multiple strings with the same value?
Thanks!
Seeing you have the same a tag in all the if-else paths im wondering why you are not doing something like this:
{% if ("aerospace" in BlogUrl || "aviation" in BlogUrl || "aircraft" in BlogUrl ||"jet-engine" in BlogUrl ||"fuel-systems" in BlogUrl || %}
//your code here
{% endif %}