1

I have a landing page with a bunch of entries, displayed from a good ol' channel entries tag pair. Now, I'd like to have a link to another page right in the middle of the entries (after 3 entries). The problem is that I can't just have two different tag sets, because I want the whole thing to be paginated. What can I do?

{exp:channel:entries channel="mychannel" limit="6" paginate="bottom"}
    <div class="block">
        {photo_matrix}<img src="{photo}" alt="{alt}">{/photo_matrix}
        {contact}{if name}<div class="hover"><div class="info"><span>Submitted By</span> {name}</div></div><!-- hover -->{/if}{/contact}
    </div><!-- block -->

    {my_pagination}{!-- (pagination snippet) --}

{/exp:channel:entries}

This is what I want:

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|


{          }
{   LINK   }
{          }

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|


[PAGE 1 of 5] [<] [1] [2] [3] [>] [LAST]

1 Answer 1

1

If you want only the first page in your pagination set to have the link you can use absolute_count conditionally.

{exp:channel:entries channel="mychannel" limit="6" paginate="bottom"}
    <div class="block">
        {photo_matrix}<img src="{photo}" alt="{alt}">{/photo_matrix}
        {contact}{if name}<div class="hover"><div class="info"><span>Submitted By</span> {name}</div></div><!-- hover -->{/if}{/contact}
    </div><!-- block -->

   {if absolute_count == "3"}
     Link goes here
   {/if}

    {my_pagination}{!-- (pagination snippet) --}

{/exp:channel:entries}

If however you want your subsequent pagination pages to have the link in position three as well then use count instead of absolute_count.

2
  • Ok one second, my link actually includes another {exp:channel:entries} tag, so when I use it, it messes everything up. So I assume you can't nest these tags. Help? @AllInOne
    – eshellborn
    Nov 25, 2014 at 22:37
  • Many ways to do this... in EE you can embed the link template. Or you could have the link entries tag on another part of the page and position it where you want via jquery... Or you could pull the link content in via AJAX.
    – AllInOne
    Nov 25, 2014 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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