Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1018713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:53:57+00:00 2026-05-16T10:53:57+00:00

Is this possible to do the following in ExpressionEngine: (code taken from here )

  • 0

Is this possible to do the following in ExpressionEngine:
(code taken from here)

IF THERE ARE RELATED ENTRIES SHOW THIS: (important to see the header)

HEADING : Related Entries:

  1. Entry 1

  2. Entry 2

  3. Entry 3

ELSE (SHOW NOTHING)
…

DONE

Code:

{related_entries id="performers"} 
{if no_related_entries} 
<h2>No Entries</h2>  {/if} 
<h2>{title}</h2>  {body}
{/related_entries}

How do I hide the header? Because the only way to check if there are related entries is to actually start the {related_entries} LOOP.

Any hints? I don’t want to hack into PHP for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:53:58+00:00Added an answer on May 16, 2026 at 10:53 am
    {related_entries id="performers"}
    {if title != ""}
     <h2>{title}</h2>
    {/if}
     {body}
    {/related_entries}
    

    This should do it, no need for no_related_entries, since you do not plan on doing anything if there is nothing.

    Since you have header tags around your title, I imagine you want to avoid printing out header tags when there isn’t any related entries.

    so if title is not empty, display, if it is, then it won’t, so you’ll avoid <h2></h2>

    don’t worry about putting a conditional around the body tag, it will just not display anything if it is blank, but if you put an html tag around it like you did the title, then you would do the same as you do w/ the title conditional.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following this question, it seems that it is possible to open a file from
In the following code, why is not possible to do this dereferencing: *arr =
Can anybody translate the following code to C++? Is this possible at all or
Is this possible at all? The idea is to have the following: if ($some_statement)
I want something like the following: foo.should_receive(:bar).with(an_instance_of(Bla))..... Is this possible? Edit: According to the
Having read around it appears this should be possible. I have the following content
is it possible to do something like the following: struct test { this {
Is this possible? My code works on Firefox. I can also get webkit to
How can I pass eventName to dbSafe() in the following fashion? Is this possible?
I have the following code in my Ninject module: this.BindFilter<PermitFilter>(FilterScope.Controller, 0) .WhenControllerHas<PermitAttribute>() .WithConstructorArgumentFromControllerAttribute<PermitAttribute>( permissions,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.