We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Is there a way to break a channel entries tag into two (2) parts t

How Do I?

TheDigicore's avatar
TheDigicore
12 posts
4 years ago
TheDigicore's avatar TheDigicore

Hi,

Is there a way to break a channel entries tag into two (2) parts so that there is content in between that is not duplicated if multiple entries are displayed? I.e. so they are linked to create one instance of an entry, however still have multiple entries displayed?

I have searched through the documentation and can not find a definitive answer to this. I tried using the categories tag however that does not seem to work for this particular method of displaying content.

Thanks

       
Tom Jaeger's avatar
Tom Jaeger
228 posts
4 years ago
Tom Jaeger's avatar Tom Jaeger

Thanks for getting in touch about this one.

There are a few ways to handle this one as a whole. But I would recommend taking a peek at the {count} variable. You can likely do something like the following.

{if {count} == 1} Static content here {/if}

https://docs.expressionengine.com/latest/channels/entries.html#count

       
TheDigicore's avatar
TheDigicore
12 posts
4 years ago
TheDigicore's avatar TheDigicore

Thank you! I’ll try that hopefully that works. I was messing around with other variables and was causing looping errors.

👍 1
       
TheDigicore's avatar
TheDigicore
12 posts
4 years ago
TheDigicore's avatar TheDigicore

Is there any other way to achieve this? I had issues when trying to implement the count variable, it basically broke the template. Thank you for your help.

       
TheDigicore's avatar
TheDigicore
12 posts
4 years ago
TheDigicore's avatar TheDigicore

Does the below make sense? I need to show the static content within the channels tag only once but have multiple entries shown at the same time otherwise i am looping the static content and it breaks the design.

{exp:channel:entries channel="portfolio" orderby="date" sort="asc"}

  // Dynamic Content


  {if {count} >= 1} 


    // STATIC CONTENT HERE ONLY ONE INSTANCE OF CONTENT WITH MULTIPLE ENTRIES SHOWN


   {/if}


  // Dynamic Content

{/exp:channel:entries}

Thank you
       
TheDigicore's avatar
TheDigicore
12 posts
4 years ago
TheDigicore's avatar TheDigicore

Please could someone help me with this?

       
Tom Jaeger's avatar
Tom Jaeger
228 posts
4 years ago
Tom Jaeger's avatar Tom Jaeger

I think you need to change the following

{if {count} >= 1}

to

{if {count} == 1}

       
TheDigicore's avatar
TheDigicore
12 posts
4 years ago
TheDigicore's avatar TheDigicore

Thank you, that does work for the first slide due to the count ==1 conditional parameter however for the subsequent slides there are issues as it is placing the div for an overlay box right above the slider item and breaking how it is displayed.

Is there another conditional parameter that is designated to only show the content once without relying on how many entries are shown?

Thank you

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.