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

Field groups in fluid fields- how to?

How Do I?

From EE Slack's avatar
From EE Slack
185 posts
one year ago
From EE Slack's avatar From EE Slack

Hi All. Anyone familiar with getting Field Groups within Fluid fields to work … ?

Have a field group defined within a fluid field - image shows it with some content in.

Have the following test template defined:

{section_page_content}
        {section_page_content:fluid_main_text_element}
        <div>Main Text Element:
            {fields}
                <div>Headline: {section_page_content:headline}{content}{/section_page_content:headline}</div>
                <div>Lead Text: {section_page_content:lead_text}{content}{/section_page_content:lead_text}</div>
                <div>Text Body: {section_page_content:text_body}{content}{/section_page_content:text_body}</div>
            {/fields}
        </div>
        {/section_page_content:fluid_main_text_element}
    {/section_page_content}

This appears to be consistent with the example given in docs … but when it generates output it gives peculiar results - with the fields block being repeated in full for each variable referenced… and with an extra blank set appended to the end. Clearly either I’m missing something obvious or there is something amiss…

Main Text Element:
Headline: Improving human performance
Lead Text:
Text Body:
Headline:
Lead Text: We believe that human performance can be improved through a programme of workshops, individual coaching and mentoring, and unqiue experiences that places you in new, challenging enviornments.
Text Body:
Headline:
Lead Text:
Text Body: No two individuals or teams are alike, and so our programmes are crated uniquely for your needs, founded on our knowledge and proven experience on what works to create positive change and growth. Each programme culminates in a challenging hpysical experience that takes you out of your usual workspace and empowers you to apply new skills into an unpredictable situation.
Headline:
Lead Text:
Text Body:

Anyone got any idea at all what is going on … and more usefully how I change this so that I get the three fields output in a single block… Thanks in advance for any thoughts / ideas / guidance.

Interested in learning more solutions or want to get to know other EE users? Read more about joining the slack here! Join Our Slack!

       
From EE Slack's avatar
From EE Slack
185 posts
one year ago
From EE Slack's avatar From EE Slack

EE’s Bryan came through with the solution to this one.

If you change your {fields} block to this I think it will fix it

{fields}
    {section_page_content:headline}<div>Headline: {content}</div>{/section_page_content:headline}
    {section_page_content:lead_text}<div>Lead Text: {content}</div>{/section_page_content:lead_text}
    {section_page_content:text_body}<div>Text Body: {content}</div>{/section_page_content:text_body}
{/fields}

The syntax is a little tricky but it mirrors the regular fluid field behavior where each “field pair” really gets translated into a conditional so it loops through and says {if field_name} content {/if} as it goes through each field individually.

       

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.