• Resolved tschen01

    (@tschen01)



    <tr>
    <td class=”text-center align-middle”>

    [if picture]

    [else]

    [/if]

    </td>

    <td class=”text-center align-middle”>
    <h6>{@family_name_khmer}{@given_name_khmer}<br/>{@post_title}</h6>
    </td>

    <td class=”text-center align-middle” id=”content-desktop”>
    [if participated_in_interview]
    [each participated_in_interview]
    [if video_link]



    [else]
    [if audio_link]



    [/if]
    [/if]
    [/each]
    [/if]
    </td>
    <td class=”text-center align-middle” id=”content-desktop”>
    [if participated_in_interview]
    [each participated_in_interview]
    [if transcript_file]

    [/if]
    [/each]
    [/if]
    </td>
    <td class=”text-center align-middle” id=”content-desktop”>
    [if participated_in_interview]
    [each participated_in_interview]
    [if translation_file]

    [/if]
    [/each]
    [/if]
    </td>
    <td class=”text-center align-middle”>
    [if participated_in_interview]
    [each participated_in_interview]
    [if interview_date]
    <h6>{@interview_date}</h6>
    [/if]
    [if interview_year]
    [if interview_month]
    [if interview_day]
    <h6>{@interview_day} {@interview_month} {@interview_year}</h6>
    [else]
    <h6>{@interview_month} {@interview_year}</h6>
    [/if]
    [else]
    <h6>{@interview_year}</h6>
    [/if]
    [/if]
    [/each]
    [/if]
    </td>
    <td class=”text-center align-middle” id=”content-desktop”>
    [if participated_in_interview]
    [each participated_in_interview]
    [if interviewees_age]
    {@interviewees_age}
    [/if]
    [/each]
    [/if]
    </td>

    <td class=”text-center align-middle” id=”content-desktop” style=”display:none”>
    [if participated_in_interview]
    [each participated_in_interview]
    [if story_included]
    {@story_included}
    [/if]
    [/each]
    [/if]
    </td>
    <td class=”text-center align-middle” id=”content-desktop” style=”display:none”>

    {@gender}

    </td>
    <td class=”text-center align-middle” id=”content-desktop” style=”display:none”>

    {@birth_location_province}

    </td>
    </tr>`

    I wrote the code above that retrieves the data very slowly, especially the picture part. I thought it might have something to do with the way im looping through all the interviews or maybe the way im retrieving the data. Is there a better way to data retrieve in pods?
    Is there a way to lazy load the data (like 10 at a page)? Instead of loading all at once?

    Same data not in pods but through wordpress
    http://humstaging.byu.edu/cambodianoralhistories/
    speed has no problem

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    I only see the content within your loop, not the loop itself.
    How are you fetching the data?

    Pagination is very important in this case. See: https://docs.pods.io/displaying-pods/pods-shortcode/

    Cheers, Jory

    Thread Starter tschen01

    (@tschen01)

    So, I actually call a facet template with a short code at the beginning:
    [facetwp template="test" limit="10"]

    which creates a table but also runs php loop on pods:

    <?php while ( have_posts() ): the_post(); ?>
    <?php echo pods( 'interviewee', get_the_id() )->template( 'Interviewee Archive 1' ); ?>
    
    <?php endwhile; ?>
    

    So if the problem is not found in the way the below code is written (like it is not looping through each item more than once looking for if participated, does the each subloop?) than what could be the problem when retrieving the data?

    [if participated_in_interview]
         [each participated_in_interview]
    	[if transcript_file]
    	     <a href="{@transcript_file._src}"><img src="http://briancroxall.net/podstest/wp-content/uploads/2019/08/KhmerFile-1.png" style="max-width: 50px;"/></a>
            [/if]
         [/each]
    [/if]

    Thank you,
    Scott

    Plugin Author Jory Hogeveen

    (@keraweb)

    No if participated_in_interview has no value then the each loop won’t run of course.

    I see you already fixed it with pagination. This is indeed the correct way to handle large(r) datasets.

    Sorry for my late reply!

    Cheers, Jory

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Slow Retrieval Speed’ is closed to new replies.