• Resolved Maniou

    (@maniou)


    Hello,

    Can you tell me if Filtering is supposed to work with Cache ?

    When i trigger something like :

    jQuery.fn.almFilter(‘fade’, ‘300’, ({repeater:”default”, cache_id:”50491065154″, cache:”true”, posts_per_page:6, post_type:”recipe”, taxonomy:”recipe_category”, taxonomy_terms:”rice”, taxonomy_operator:”IN”}));

    I’ve got the “page” result from the cache-id of the shortcode on the page.

    The same if i don’t put any cache info when calling jQuery.fn.almFilter.

    I’m missing something ?

    Thank you,

    https://www.ads-software.com/plugins/ajax-load-more/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Maniou

    (@maniou)

    In fact the problem don’t seems related to “cache” but to “filtering’

    When cache is desactivated (main shortcode and filtering buttons).

    If i do :

    jQuery.fn.almFilter('fade', '300', ({repeater:"default", posts_per_page:6, post_type:"recipe", taxonomy:"recipe_category", taxonomy_terms:"rice", taxonomy_operator:"IN"}));

    The request on admin-ajax.php is :

    ?action=alm_query_posts&query_type=standard&nonce=4814945b97&repeater=default&theme_repeater=null&comments=&post_type%5B%5D=recipe&post_format=&category=&category__not_in=&tag=&tag__not_in=&taxonomy=recipe_category&taxonomy_terms=&taxonomy_operator=&taxonomy_relation=&meta_key=&meta_value=&meta_compare=&meta_relation=&meta_type=&author=&year=&month=&day=&post_status=&order=DESC&orderby=date&post__in=&post__not_in=&exclude=&search=&custom_args=&posts_per_page=6&pageNumber=0&offset=0&preloaded=true&preloaded_amount=6&seo_start_page=1&previous_post=false&previous_post_id=&previous_post_taxonomy=&lang=&slug=recipe

    The param taxonomy_terms is empty, it shoud contains “rice”.

    Plugin Author Darren Cooney

    (@dcooney)

    The almFilter function expects dats attributes to be passed like the example – [data-post-type]
    https://connekthq.com/plugins/ajax-load-more/docs/public-functions/

    You are passing the filters like this: post_type, taxonomy_terms etc.

    I think if you fix this and follow the example you will get this working.

    Cheers,

    Thread Starter Maniou

    (@maniou)

    Thank for your response, i was using almFilter this way just to try to see what was going on.

    On the website i’m using it the way you describe :

    The shortcode :
    echo do_shortcode('[ajax_load_more posts_per_page="6" preloaded="true" preloaded_amount="6" post_type="recipe"]');

    The buttons :
    <li class="light"><a title="Rice" data-taxonomy_operator="IN" data-taxonomy_terms="rice" data-taxonomy="recipe_category" data-post_type="recipe" data-posts_per_page="6" data-scroll_distance="10" data-repeater="default" href="#"><i class="ico icon-rice"></i> <span>Rice</span></a></li>

    and below the JS like your example.

    (...)
             var data = el.data(), // Get data values from selected menu item
                 transition = 'fade', // 'slide' | 'fade' | null
                 speed = '300'; //in milliseconds
    
    		 console.log(data);
             jQuery.fn.almFilter(transition, speed, data); // reset Ajax Load More (transition, speed, data)
    (...)

    If i press the button Rice, the call on admin-ajax.php is done with thoses params :

    action=alm_query_posts
    author=
    category=
    category__not_in=
    comments=
    custom_args=
    day=
    exclude=
    lang=
    meta_compare=
    meta_key=
    meta_relation=
    meta_type=
    meta_value=
    month=
    nonce=305b88a578
    offset=0
    order=DESC
    orderby=date
    pageNumber=0
    post__in=
    post__not_in=
    post_format=
    post_status=
    post_type[]=recipe
    posts_per_page=6
    preloaded=true
    preloaded_amount=6
    previous_post=false
    previous_post_id=
    previous_post_taxonomy=
    query_type=standard
    repeater=default
    search=
    seo_start_page=1
    slug=recipe
    tag=
    tag__not_in=
    taxonomy=recipe_category
    taxonomy_operator=
    taxonomy_relation=
    taxonomy_terms=
    theme_repeater=null
    year=

    I can’t figure why taxonomy_terms and taxonomy_relation are empty (and why it’s ok for the others param like taxonomy).

    Plugin Author Darren Cooney

    (@dcooney)

    Can you post your button html? I want to see what the data attributes look like.

    Thread Starter Maniou

    (@maniou)

    Yes you have it just before.
    If you want where i can send you privately the link to see the web page ?

    Plugin Author Darren Cooney

    (@dcooney)

    All I need to see if you the button markup. to see if you have the data attributes set up correctly.

    Thread Starter Maniou

    (@maniou)

    The button :

    <li class="light"><a title="Rice" data-taxonomy_operator="IN" data-taxonomy_terms="rice" data-taxonomy="recipe_category" data-post_type="recipe" data-posts_per_page="6" data-scroll_distance="10" data-repeater="default" href="#"><i class="ico icon-rice"></i> <span>Rice</span></a></li>

    Also when i click on the button, the div alm-listing is taking the button param’s correctly :

    <div class="alm-listing alm-ajax " data-images-loaded="false" data-transition="slide" data-destroy-after="" data-button-class="loading" data-button-label="Older Posts" data-pause="false" data-pause-override="false" data-max-pages="5" data-scroll-distance="150" data-scroll="true" data-lang="" data-posts-per-page="6" data-offset="0" data-orderby="date" data-order="DESC" data-post-status="" data-custom-args="" data-search="" data-exclude="" data-post-not-in="" data-post-in="" data-author="" data-day="" data-month="" data-year="" data-meta-type="" data-meta-relation="" data-meta-compare="" data-meta-value="" data-meta-key="" data-taxonomy-relation="" data-taxonomy-operator="" data-taxonomy-terms="" data-taxonomy="recipe_category" data-tag-not-in="" data-tag="" data-category-not-in="" data-category="" data-post-format="" data-post-type="recipe" data-repeater="default" data-preloaded-amount="6" data-preloaded="true" data-scroll_distance="10" data-posts_per_page="6" data-post_type="recipe" data-taxonomy_terms="rice" data-taxonomy_operator="IN">
    Plugin Author Darren Cooney

    (@dcooney)

    As I said earlier you are passing the data params incorrectly.

    <li class="light"><a title="Rice" data-taxonomy-operator="IN" data-taxonomy-terms="rice" data-taxonomy="recipe-category" data-post-type="recipe" data-posts-per-page="6" data-scroll_distance="10" data-repeater="default" href="#"><i class="ico icon-rice"></i> <span>Rice</span></a></li>

    Data params need to use ‘-‘ vs ‘_’

    Thread Starter Maniou

    (@maniou)

    Sorry i didn’t get your first answer, i’m going to change that !

    Thread Starter Maniou

    (@maniou)

    Everything is fine now, thanks again !

    Plugin Author Darren Cooney

    (@dcooney)

    Excellent!
    Good luck with your project!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Filtering Cache’ is closed to new replies.