0

So I'm using bloqs (https://eebloqs.com/) for a project. On the backend, it seems to allow the content to be re-ordered:

draggable bloqs

but in the code on the front end the bloqs are hard coded in place in the template:

    {sub_page_blocks}
        {content_and_image_50_50}
            <div class="medium-6 small-12 columns">
                <h2>{section_title}</h2>
                {section_content}
            </div>
        {/content_and_image_50_50}
    {/sub_page_blocks}

    {sub_page_blocks}
        {secondary_page_3_column_with_header}
         <h3>{section_content_second_page}</h3>
        {/secondary_page_3_column_with_header}
    {/sub_page_blocks}

Is there a way to code the template to allow the user to reorder the bloqs and have that order be applied to the front end? I've checked the plugin site for help but the documentation does not exist. I'm really shooting in the dark here.

Thanks!

1

Just use a single tagpair for the Bloqs field, it renders them in the order specified on the publish page. You can think of the individual Bloq field pairs as conditionals, e.g. if the next atom is this type, use this code. Example using your tags above (assumes you have the Bloq field, Bloqs, and atoms referred to correctly):

{sub_page_blocks}
    {content_and_image_50_50}
        <div class="medium-6 small-12 columns">
            <h2>{section_title}</h2>
            {section_content}
        </div>
    {/content_and_image_50_50}

    {secondary_page_3_column_with_header}
        <h3>{section_content_second_page}</h3>
    {/secondary_page_3_column_with_header}
{/sub_page_blocks}
1
  • Hey, you nailed it. Thank you for the help. Apr 11 '17 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.