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

Channel:Entries Headings

Feature Requests

stereoi123's avatar
stereoi123
31 posts
one year ago
stereoi123's avatar stereoi123

We need a mechanism for creating headings within the channel:entries tag. Similar to category_heading and low_alphabet_heading.

This would make developing w/ EE much more straight forward.

       
Rob Allen's avatar
Rob Allen
3,102 posts
one year ago
Rob Allen's avatar Rob Allen

Can you give an example of what you want to do?

       
adamholland's avatar
adamholland
1 posts
one year ago
adamholland's avatar adamholland

This would indeed make development with EE much more straightforward. Is there a specific platform or system you are referring to when you mention “EE”? iq test

       
stereoi123's avatar
stereoi123
31 posts
one year ago
stereoi123's avatar stereoi123

Hi and sorry for this late response!

The project that brought this to mind is a portfolio gallery for an interior designer.

They wanted to list their portfolios by year, but they do not always publish new portfolios in the year the project was completed. So, we added a “year” input in their publish form which is great for listing the year, but difficult to use for grouping / listing the entries under a year heading.

Asking them to use the Entry Date input as the year designation caused other issues and seemed clunky to have the client use that method.

This may already be resolved by the additional functionality in EE7 (structure, pro search). That site was developed in EE6.

If there is a simple way to accomplish this in EE7, I’d love some basic guidance as we come across this issue often-ish.

       
Rob Allen's avatar
Rob Allen
3,102 posts
one year ago
Rob Allen's avatar Rob Allen

Ideally you’d use the Entry date, if you can get them to do that you could use the date_heading tag to automatically group entries by day, week, month or year. https://docs.expressionengine.com/latest/channels/entries.html#date_heading

πŸ‘ 1
       
stereoi123's avatar
stereoi123
31 posts
one year ago
stereoi123's avatar stereoi123

Hi Rob, Thank you very much! The date_heading tag. - I had not come across that one before. Very useful.

I have another, more complex example of what I am referencing in my post:

For a school’s website, they have about 14 sports students can participate in. Each sport is broken down into teams divided by grade. Example: Baseball (one sport) has 3 teams: Middle School Baseball, Junior Baseball and Varsity Baseball.

I need to create a sidebar nav for these teams. As you can imagine the list is very long. So, I want to use collapse panels so the sidebar will display all Sports. When a sport name, like Baseball, is clicked, the collapse will expand to show the three baseball teams. - Repeated for each sport.

I have tried using Categories with not much luck.

I have 2 channels setup. One holds the Sport names (Baseball, Football etc…) and one holds Team content. In the Team channel I have a select field that pulls values from the Sports channel. So the Middle School Baseball entry will have “Baseball” selected as the team sport.

After trying a few methods, I cannot create a conditional or other method to select the first Team returned under Baseball and insert the opening div of the collapse panel, then likewise select the last Team under Baseball and insert the closing div tag for the collapse.

Would you have any guidance for that?

The filtering system in pro variables seems to require a page refresh which I am trying to avoid.

       
Rob Allen's avatar
Rob Allen
3,102 posts
one year ago
Rob Allen's avatar Rob Allen

A quick and dirty way to do this might be to utilise the details tag to give you collapsed content, not ideal sematically but it will give you a solution:

Assuming team_related_sport if the field you related teams to sports with (a Relationship field).

<h2>Sports</h2>
{exp:channel:entries channel="sports"}
<details>
<summary>{title}</summary>
  <ul>
    {team_related_sport}
   <li><a href="http://YOUR_LINK">{team_related_sport:title}</a></li>
   {/team_related_sport}
  </ul>
</details>
{/exp:channel:entries}

That will give you a list of sports, where each sport has the teams below it.

πŸ‘ 1
       
stereoi123's avatar
stereoi123
31 posts
one year ago
stereoi123's avatar stereoi123

Rob, That is great. Thank you very much!

In writing out & discussing with you I also came across the parents tag pair for relationship fields. You are correct, relationships is better for this use than my original select field. In case it helps anyone using Bootstrap Collapse, I’ve copied my code below. Both your version, using <details> and this will get the job done.

{exp:channel:entries channel="sports" orderby="title" sort="asc"}
    <h5 type="button" data-bs-toggle="collapse" data-bs-target="#{url_title}" aria-expanded="false">{title}</h5>
    {parents field="sport_relationships"}
{if parents:count == 1}<div id="{url_title}" class="collapse">{/if}
            <a href="http://THE_LINK">{parents:title}</a>{if parents:count != parents:total_results}\<br\>{/if}
{if parents:count == parents:total_results}</div>{/if}
    {/parents}
{/exp:channel:entries}

Thanks again!

       
Rob Allen's avatar
Rob Allen
3,102 posts
one year ago
Rob Allen's avatar Rob Allen

Glad we helped you in the right direction!

       
daymansalvort's avatar
daymansalvort
1 posts
one year ago
daymansalvort's avatar daymansalvort

oh nice to see your problem got solved. well done Rob

       

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.