17

The solution turns out to be fairly simple and the logic can pretty much work the same. EE relationship fields let you pull the count separately from the tag pair like this: {relationship-field:count} So, the solution is to use that in our conditional logic: {if "{relationship-field:count}" == ""} do stuff {if:else} do relationship stuff {/if}


10

Long time to add to this but... {relationship-field} do relationship stuff {if relationship-field:no_results} Empty stuuf {/if} {/relationship-field}


9

You can use the search parameter. {exp:channel:entries search:image_custom_field_name="not IS_EMPTY" ...} ... {/exp:channel:entries} This will return entries where the image custom field has been filled in.


9

I was able to accomplish what I was after using the following... {if "{categories}{category_url_title}{/categories}"!=""} CATEGORY EXISTS {if:else} NO CATEGORY EXISTS {/if}


7

...And as soon as I write it down in a question, I figured out my mistake. Correct solution for future visitors was: {if "{product_videos:total_children}" > 0} //do something {/if}


6

You should try changing your conditional to test if the content is not equal to "". Also this should not be an elseif, it should simply be and else statement {exp:channel:entries channel="{segment_1}"} {matrix_primary_tag_pair} {matrix_field_1} {if matrix_field_2 != ""} {matrix_field_2} {matrix_field_3} {if:else} {...


6

By default EE prevents the advanced conditional parser from processing anything between <script> tags. Try adding this config variable: $config['protect_javascript'] = 'n';


6

After some help from the wonderful Mr. Croxton I was able to sort it out. Here is how to pull this off. When grabbing the data in your model you need to stash the {entry_id} of the parent list (I call mine {e_id} for no real reason). Then, when setting the nested list, provide context with the {entry_id} by using name="employees_{entry_id}". {exp:stash:...


6

So yeah. Parse order. I take it you've seen this pdf. If not, take a look, study it well. What you need is for the opening tag to be in order before you hit stage 5: the parsing of module/plugin tags. In order to do that, you can only use simple conditionals in combination with early parsed global variables and preload replace variables. Native early parsed ...


6

Member defined variables like {member_group} are parsed last by default, so your advanced (not simple) conditionals will never properly read the member data. View parse order pdf by Low. You need to install an add-on to move the parsing of the member defined variables earlier. Try Low Variables, Mo' Variables, or any other add-on that has this feature.


6

First off, you can't have any "else" statements in your conditional or it will be considered "advanced". But more importantly in relation to how you're writing these: Simple Conditionals aren't just about the operators, control structures & variables, but the format is actually critical. The actual format must be: {if early_parsed_variable == "string"}...


6

Try this: <li class="large-4 small-3 columns"> {right_image_1} {if description} <img class="avatar w-alt" alt="{description}" src="{url}" /> {if:else} <img class="avatar wo-alt" alt="{title}" src="{url}" /> {/if} {/right_image_1} </li>


5

Generally speaking the home page can be called to ways: (1) in absence of {segment_1} or (2) when the site is using the designated primary template_group and index. Let's deal the first one first, you'd just use the conditional {if segment_1 ==""} what you want {/if} Will test for the home page. Now, if you also consider it the 'homepage' when people are ...


5

You can use {if banner_matrix_field:total_rows >= 1} graphic{/if} Matrix docs link


5

The documentation is confusing on the EL site. If you prefix the single tags variables count & total_results with the custom field name, you will have access to control your markup with conditionals. This should work: {cf_article_related} {if cf_article_related:count == 1} <aside> <h2>Further Reading</h2> &...


5

To a conditional to be considered a simple one, it needs to use snippets or early parsed variables. This isn't the case when you're using freebie. Unlike Low Seg2cat, that parses really earlier on parsing stages, Freebie parses together with all modules. Can you remove freebie? If you can, try this: <section class="blog-listing"> {if segment_X == ...


5

Well, you're having an HTML issue, not an EECMS issue, because an element can't have more than oneclass attribute. Use this: <li class="{if segment_1 == "donate"}active {/if}dropdown">Donate</li> Or you can simple remove the dropdown class and use a child selector or a descendant selector. Even for JavaScript, you don't need this class. You ...


5

Or set a $env_global['myjs'] in the config.prod.php with the analytics code ID number and leave that var blank in the config.dev.php then just {myjs} in the template and it only outputs the ID in production.


5

The following conditional will achieve what you want: {if {current_time format="%m"} <= 6} <p>do Jan through June</p> {if:else} <p>do July through December</p> {/if} Edit: Replying to request for March-thru-September date range: Since the %m flag on the date format represents each month as a number (and conveniently one-...


5

EE simply removes any tags corresponding to custom fields that have no data. So by the time EE is ready to parse the outer {if} conditional, it will look like this: {if > 0} Try wrapping the field tag in quotes: {if '{tech_documents:total_rows search:doc_thumb="IS_EMPTY"}' > 0}


4

I think, you should use parameter search:content_featureimage="IS_EMPTY" within channel entry tag.


4

You can use {global:env} and {global:env_full} by default. To add in extra variables see the $master_global array in config.master.php.


4

For deeper understanding, read about Rendering Stages in EE user guide. Advanced conditionals are processed after module tags. Putting it simply, exp:crumbly:breadcrumbs is processed before if statements, so EE engine is receiving 3 exp:crumbly:breadcrumbs opening tags and just one closing tag. There are 2 possible solutions: 1) Have separate code for ...


4

The {reverse_related_entries} does support only 6 parameters of weblog, status, sort, orderby, offset, limit. So "show_expired" parameter will not work here. In that case I always prefer to use Playa but never tried with EE v1.6+. I think, you are populating a single weblog entry and would like to show all the parents weblogs with {reverse_related_entries}...


4

Here are two options you could try. Vim Interactive has a date plug-in, DT Plugin, that lets you set the year offset within the plug-in tag itself. Solspace also has a date plug-in called Date Field Filter. To set the offset you require would mean you need to turn on PHP in your templates. I'd recommend trying Vim's plug-in first and see of this solves your ...


4

Robert! First of all, let's fix your conditionals. Conditionals using numbers don't need quotation marks. From docs: If you are testing against a word, you should enclose the word in single or double-quotes. If you are testing against a number, then you do not need to use quotes. So: {if category_id == 100} Even so, this code doesn't work because {...


4

This looks like a bug on the no_results conditional, to me. May I suggest you something? Let's change your approach to this. Look at the docs. You should take advantage of the parsing order and do not let your code run if you can avoid. So, use simple conditionals around the channel:entries variable pair. This way, in the two first situations, the parsing ...


4

To be on the safe side, I'd check for numerical values only, like 201308. Something like this: {if {event_dates:start_date format="%Y%m"} == {event_dates:end_date format="%Y%m"}} same month {if:else} not same month {/if} When debugging the advanced conditionals, try to remove them and add them one at a time to see which actual one is causing the ...


4

I'd recommend trying class="{if '{social_links:network}' == 'Google'}google{/if}" Whatever you use for the conditional, if you match up the quotes usage (double versus single), it makes a big difference.


Only top voted, non community-wiki answers of a minimum length are eligible