I would like to break out my pagination code into a separate embed file as the same code is used in multiple templates. However when I do it's just spitting out EE tags into the page rather than parsing them.

Is this a parse order issue? Is it possible to achieve this?


  <div class="card card-horizontal clearfix event-list 
    {if segment_2 == 'weekly'}hidden-xs-up{/if}" 
    {if segment_2 == 'weekly'}data-day="#{event_start_date  format='%D'}"{/if}
    <div id="events-carousel" class="carousel slide" data-ride="carousel">
    {event_images cover_only="yes"}     
      <a href="/iba-kids/events/{url_title}">
        <img class="card-img-top img-fluid" src="{image:url:medium}" alt="{image:title}">
    <div class="card-block">
      <h4 class="card-title">{title}</h4>
      <p class="card-text">{exp:power_truncate length="110" cut_words="n" suffix="..."}{event_snippet}{/exp:power_truncate}</p>
      <a class="btn btn-primary category" href="/iba-kids/events/{url_title}">Read Article</a>      



Embed Code:

          <ul class="pagination pagination-lg">
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="First Page">First</a>
            <li class="page-item">
              <a class="page-link {if current_page}active{/if}" href="{pagination_url}">{pagination_page_number}</a>
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="Last Page">Last</a>

          <ul class="pagination pagination-lg pull-xs-right">
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="Previous">Previous</a>
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="Next">Next</a>
  • can you provide an example of your channel entries loop with the embed? – Jim Wyse Mar 30 '16 at 19:57
  • Hey Jim, just added the code to the post. Thanks – KoalaKid Mar 30 '16 at 20:03
  • You need to use a snippet instead for the pagination code, as an embed is parsed completely separately and after the parent template is parsed. – Peter Lewis Mar 31 '16 at 6:59

Most likely a parse order issue http://loweblog.com/downloads/ee-parse-order.pdf Embeds are processed after module tags.

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.