4 Things You Probably Don’t Know About ExpressionEngine Channel Entries

1.) Related Categories Mode

This options allows you to output other entries with the same category. It is to be used on only single entry pages. There are other ways to accomplish this but if it’s available why not use it?

<code>
{exp:channel:entries related_categories_mode=“yes” custom_fields=“yes” member_data=“yes”}
<h2>{title}</h2>
{body}
<div class=“posted”>Posted by {author} on {entry_date format=‘%m/%d’} at {entry_date format=‘%h:%i %A’}</div>
{/exp:channel:entries}
</code>

2.) Order by Date Field (Custom)

Natively you CANNOT display entries based on a custom date field.You can use the entry date and expiry date but not a custom field. Luckily the guys at Solspace have a FREE add-on that does just that. We have used it on a few event related sites and it’s works well.

3.) Disabling Relationships

You should be disabling as many things as you can to get maximum performance from your ExpressionEngine sites. Relationships is a little used parameter to speed things up further. Thanks to Solpace for this tip.

<code>{exp:channel:entries channel=“news” limit=“10” disable=“categories|category_fields|member_data|relationships”}
<h2>{title}</h2>
{body}
{/exp:channel:entries}</code>

4.) Channel Entries within Channel Entries

You cannot have an channel entries tag within a channel entries tag. The below will not work.

<code>{exp:channel:entries channel=“meat“ limit=“10“ search:cf_meat_body=“steak“ }
{title}
…..OTHER Custom Fields
{if no_results}
    <h1>There are no results but please see these entries</h1>
    {exp:channel:entries channel=“meat“ limit=“10“ }
        {title}
        ….OTHER Custom Fields
    {/exp:channel:entries}
{/if}
{/exp:channel:entries}</code>

Embeds

Embeds will work

<code>{exp:channel:entries channel=“meat“ limit=“10“ search:cf_meat_body=“steak“}
{if no_results}
     <h1>There are no results but please see these entries</h1>
     {embed=“templategroup/embedname“}
{/if}
{title}
...OTHER Custom Fields
{/exp:channel:entries}</code>

In embed template:

<code>{exp:channel:entries channel=“meat“ limit=“5“}
{title}
…..OTHER Custom Fields 
{/exp:channel:entries}</code>

The best way is to use a Low Variable

<code>{exp:channel:entries channel=“tester“ limit=“1“ search:cf_meat_body=“steak“}
{if no_results}
<h1>There are no results but please see these entries</h1>
{exp:low_variables:parse var=“lv_embed“}{/if}
{title}
...OTHER Custom Fields
{/exp:channel:entries}</code>

In low variables template:

<code>{exp:channel:entries channel=“meat“ limit=“5“}
{title}
…..OTHER Custom Fields 
{/exp:channel:entries}</code>

Hope you found that useful, what are your channel entries tips?

Comments

Comment: 1
Gustavotup , Mar 6, 2018

cialis online <a href=http://kjcialishuef.us/#1740>generic cialis</a> cialis prices <a href=http://kjcialishuef.us/#6837>cialis coupon</a>

Comment: 2
MichaelAcemy , Mar 10, 2018

buy generic Viagra <a href=http://viagra-generics.us/#721>buy generic viagra</a> Viagra generic <a href=http://viagra-generics.us/#1273>generic viagra</a>

Comment: 3
Terrybak , Mar 10, 2018

<a href=http://viagrawithoutdoctorprescr.today/#2775>viagra without a doctor prescription</a> <a href=http://viagrawithoutdoctorprescr.today/#2014>viagra without a doctor prescription</a>

Comment: 4
MichaelAcemy , Mar 11, 2018

generic Viagra online <a href=http://viagra-generics.us/#9306>viagra generic</a> generic Viagra available <a href=http://viagra-generics.us/#3012>viagra generic</a>

Comment: 5
Terrybak , Mar 16, 2018

<a href=http://viagrawithoutdoctorprescr.today/#9074>viagra without a doctor prescription</a> <a href=http://viagrawithoutdoctorprescr.today/#8595>viagra without prescription</a>

Comment: 6
Robertfar , Mar 17, 2018

viagra without a doctor’s prescription <a href=http://viagrawithoutdoctorprescr.today/#3036>viagra on line no prec</a> viagra without a doctor <a href=http://viagrawithoutdoctorprescr.today/#6273>viagra on line no prec</a>

Comment: 7
Thomasdap , Mar 18, 2018

generic for Viagra <a href=http://viagra-generics.us/#866>viagra generic</a> generic Viagra <a href=http://viagra-generics.us/#5110>generic viagra</a>

Leave a comment

" What you do not want to happen to you, do not do it yourself either" Sextus the Pythagorean