• Resolved tobiasmalikowski

    (@tobiasmalikowski)


    Hi Darren,

    is there a way to access the ALM Query result in a repeater template?
    The reason I’m asking is I use the repeater template to display posts and a hidden modal, which opens by clicking the post.

    Additionally i have a previous and next button in the modal, to open the previous or next modal. Live Example, see reference section.

    The way I’m solving this right now is using the repeater variable $alm_item (-1 for previous button, +1 for next button).

    Currently I’m developing a Google Map which displays the posts as markers (got this already working local). If a marker gets clicked the modal should open. So I need to use the post ids instead of $alm_item to open the modal, since the map is not generated by ALM.

    What I want to do: Create an array containing all post ids in the same order as ALM outputs them. Then I can assign the ids properly to the modals. The only way I can imagine this is knowing the query result before the repeater template gets called.

    Thanks for your help.

    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tobiasmalikowski

    (@tobiasmalikowski)

    Otherwise I also could assign the post id to the posts (which adds the open modal functionality) and use JavaScript to get the post ids of the previous and next posts and assign them.

    Let me know what you think.

    Plugin Author Darren Cooney

    (@dcooney)

    Hi @tobiasmalikowski,
    THe query result is not passed to the repeater template so I don’t you are able to access that data.

    If you get a work around working I’d like to hear it.

    Cheers,

    Thread Starter tobiasmalikowski

    (@tobiasmalikowski)

    Hi @dcooney,

    I was able to solve this. In the repeater templates I’m using the post_id, so the setup for opening the modals works by default. After that I included the previous and next functionality with some clever JavaScript.

    Thanks, I will close this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Access ALM Query result in repeater template’ is closed to new replies.