Questions tagged [ifelse]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
55 views

How to check if EE member has a website address (field carries http:// so it always returns true )

I have the following code: {if url} <p><strong>Website</strong><br /> <a target="_blank" href="{url}">{company_name}</a></p> <hr /> {/if} ...
Abs's user avatar
  • 465
0 votes
1 answer
135 views

How to add a different style to the first 2 entries in a channel call

I want to add a different class and fields to the 1st and 2nd entries produced from the channel entries call. I then want the rest of the entries on the page to be the same style, that style should ...
zizther's user avatar
  • 320
1 vote
7 answers
493 views

If conditional using category selections

Is there a way of saying If a category contains two selections, display this CSS If a category contains one selection display this CSS instead. I can't seem to find the right formula of {if} ...
sazzy's user avatar
  • 31
0 votes
2 answers
144 views

What is the Wildcard for expression engine?

I am trying to use the wildcard for my {if} statement. Where I could have P12,P24,P36,48, etc. {if segment_4 !="" && segment_4 !="P*"} But The wildcard is not working for me, does the ...
Funkefied's user avatar
  • 413
1 vote
2 answers
614 views

if:else not working with my matrix tag pair

Maybe I am a moron, but i just can't get this to work. Iv anyone can help me... please do so before i start hurting myself... :p I'm working with EE 2.5.5 and Matrix 2.5.2. I've got a channel called ...
David Lang's user avatar
1 vote
1 answer
1k views

Using OR in an if statement

I have this code: {if segment_1 != "slug1" || segment_1 != "slug2"}<h2>Text</h2>{/if} For some reason this does not work with the second instruction after the OR operator. If I remove ...
MarkerMaker's user avatar
2 votes
1 answer
111 views

Affecting the last Category in a list

I have this code: {categories}{category_name}, {/categories} Outputting in a Entries Tag Pair. I would like to remove the comma from the last outputted category only. I am thinking an IF ...
MarkerMaker's user avatar
1 vote
2 answers
398 views

If Page is not home page [duplicate]

I have a separate navigation that I want displayed on all pages that are not the home page. I thought something link this would work but not quite: {if segment_1} {if:else} <nav class="main-nav"&...
Niall Thompson's user avatar
3 votes
2 answers
1k views

PHP Syntax Error from ExpressionEngine Template

Here's some code I'm using to generate Breadcrumbs on my site. Unfortunately the client has quite specific requirements in terms of URLs, so I've had to play around with Crumbly's tag a little using ...
Jack's user avatar
  • 364
2 votes
1 answer
146 views

Limit entry using status and categories

I have a "featured item" part on my site that is controlled with a new status i created called "featured". I have 8 parent categories, and would like to have 8 different featured items, 1 unique for ...
Funkefied's user avatar
  • 413
4 votes
2 answers
3k views

Return message: if no results

I am trying to do something which I suspect is quite simple. I am referencing a channel field to rerun results to populate a series of check boxes. If there are no results I wish to say 'There are no ...
Niall Thompson's user avatar
4 votes
2 answers
3k views

What is wrong with this IF/ELSE conditional?

On events pages that meet the first conditional statement (first segment is 'events' and second segment is 'not empty') the image parses as expected. However, when the first segment is 'member-...
Dan Johnson's user avatar
  • 1,110
26 votes
7 answers
6k views

Difference between quoted and unquoted comparison syntax

In general, when comparing variables in templates, I use unquoted variable names. e.g., {if segment_3 == category_url_title} If comparing to an actual value (not a variable), I quote the value. e.g.,...
Derek Hogue's user avatar
  • 17.4k

1
2