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

Need Help Outputting Categories/Entries

How Do I?

rydedigital's avatar
rydedigital
18 posts
8 years ago
rydedigital's avatar rydedigital

Sure, this is the page here:

http://dev.baxterharries.co.uk/our-team

At the moment it’s using Derek’s method which you will see isnt working as expected.

For example, the first block should only include Deborah Baxter but you will see that all are featured and then each row thereafter just repeats as the former.

Should be something so simple to achieve but often find this issue with our builds (usually WP migrations).

Hope you can help.

Thanks Scott

       
Derek Jones's avatar
Derek Jones
7,561 posts
8 years ago
Derek Jones's avatar Derek Jones

Ugh, sorry Scott! Noticed a typo in my code sample, which I’ve corrected above. Helps if you set and reference an embed variable with the same name!

       
T Adams's avatar
T Adams
36 posts
8 years ago
T Adams's avatar T Adams

Give this a try. I think this should work

{exp:channel:categories category_group='4' style='linear' show_empty='no'}
  <h3 class="staff-category-header">{category_name}</h3>
  {embed='template_group/team_entries' team_category='{category_id}'}
{/exp:channel:categories}
//Team Entries
{exp:channel:entries channel="team" sort="desc|asc" category="{embed:team_category}" status="open" dynamic="no"}

<div class="col span-3-of-12">
<a href="http://{title_permalink=%27our-team/profile%27}%22class=%22staff-profile" title="Go to {title}" class="staff-profile matchheight">_{exp:ce_img:single_src="{staff_image}"_width="600"_height="600"_allow_scale_larger="yes"_add_dims="no"_crop="yes"_attributes="alt='{title}'class='img-responsive no-check'"_}_<!-- Image Caption -->_<div class="text-box">_<div class="caption">_<h4>Read Bio</h4>_</div>_</div>_</a>
</div>
{/if}

<h2 class="staff-name">{title}</h2>
{job_title}{if job_title_description}
({job_title_description}){/if}
{if areas_of_expertise}
Areas of Expertise
<ul class="skills-list">
<li>{areas_of_expertise:list_item}</li>
</ul>
{/if}

{if email_address OR linkedin}
<ul class="staff-contact-small-list">
{if email_address}<li><a href="mailto:{email_address}" class="email-small">{email_address}</a></li>{/if}
{if linkedin}<li><a href="http://{linkedin}" class="linkedin-small" target="_blank" rel="noopener">{linkedin}</a></li>{/if}
</ul>
{/if}
</article>
<a href="http://{title_permalink=%27our-team/profile%27}" title="Read Bio" class="staff-profile-bttn">Read Bio</a>
</div>
{/exp:channel:entries}
       
T Adams's avatar
T Adams
36 posts
8 years ago
T Adams's avatar T Adams

First time I am using the modulo function, so thanks Derek for bringing my attention to that 😊.

T.

       
T Adams's avatar
T Adams
36 posts
8 years ago
T Adams's avatar T Adams

hmm not sure my modulo math is right, so feel free to substitute it with a regular (if count == 1) which I think should also work.

       
T Adams's avatar
T Adams
36 posts
8 years ago
T Adams's avatar T Adams

Actually, I do not think the If is even needed at all, I’ve edited the code

       
rydedigital's avatar
rydedigital
18 posts
8 years ago
rydedigital's avatar rydedigital

Thanks guys, really appreciate the help - works a charm 😉

       
1 2

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.