Multiple pod instance in a template?

This topic is: not resolved

This topic contains 4 replies, has 3 voices, and was last updated by  hsatterwhite 2 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #164934

    jpx3m
    Participant

    Hello,

    Can you guys please tell me if it is possible to have multiple pod query on a template?
    what i want to do is a page that shows videos uploaded by the members but having at least two sections of content in the page.

    1. Sorts by date and;
    2. Sorts by rating

    I know it must be possible if I use the page only option and not pass it into the magic tag, or is it possible with magic tags too?

    thanks

    #164935

    tomhermans
    Participant
    Post count: 3

    why don’t you display them on e.g. rating and let them rearrange them with jquery …
    or maybe via AJAX ?

    I think a pod-page is the best option for this, or a wp-page with custom code..

    #164936

    hsatterwhite
    Member

    It’s definitely possible. In the page template you create simply adjust the the ORDER BY parameter for your findRecords(); method. Adjusting this will allow you to order videos how you need them and this can easily be done by creating two instance of the Pods object.

    #164937

    jpx3m
    Participant

    @hsatterwhite – How can i use magic tags them?
    Can {@name} determine which instance of pods to get the data from?

    thanks for your reply.

    #164938

    hsatterwhite
    Member

    The following code will help you present find video records and sort them by date descending (showing the newest first). If you want to utilize video ratings, then I will need some more information on the Pod field that you’re using to store the rating, so we can hopefully sort by it. This should get you started though!

    Also note that in the following example I’m assuming your Pod name is videos.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting