Forums Forums Search & Filter Pro RestrictContentPro Integration

Viewing 10 posts - 1 through 10 (of 31 total)
  • Anonymous
    #141814

    Hi,
    What’s the best way for integrating SearchAndFilterPro with RestrictContentPro to ensure search results are filtered based on RCP content restriction settings?

    ty!

    Trevor
    #141851

    Did you try the combination of plugins and did it work or not?

    Anonymous
    #141975

    Yes I did and no it doesn’t.

    RCP replied: The problem is that you’re using a shortcode from a custom plugin. Our code only removes restricted posts from the main WordPress query – not custom queries and shortcodes as well. That would require some custom code. Depending on how that shortcode is set up, you may just be able to copy our code from query-filters.php to a custom plugin and remove this chunk:
    if ( ! $query->is_main_query() ) {
    return;
    }

    So is it worth persisting with SearchAndFilterPro or should I switch to SearchWP is my issue at the moment. What’s the best way to do it with S&FPro?

    Anonymous
    #141977

    Example use cases:
    Client has four membership/subscription levels: free, Politics, Economics, and Plus (plus includes all content).
    Content has to be restricted by subscription level, and content posts are also tagged by category so they can be filtered on specific pages for that category.
    Ie: a politics page, or an economics page

    Not logged in:
    On Search Results Page: Sees all content, but there is a “restricted – get access” indicator / button.
    Includes feature to filter only content they are allowed to see. Off by default.
    On Econ & Policy pages (via search shortcode + category):: Sees only free content

    Logged in – Econ / Politics
    On Search Results Page: Sees all content, but there is a “restricted – get access” indicator / button.
    Includes feature to filter only content they are allowed to see. Off by default.
    On Econ and/or Policy pages (via search shortcode + category): Sees only content they have access to, plus free content
    Restricted indicator before they click through to the body of the post.

    Logged in – Plus
    On search results page: All content, no filter shown because no filter needed
    Econ / Policy pages (via search shortcode + category): All content.

    Trevor
    #142051

    I think it can be done in our plugin, as we have a filter that you can use:

    Edit Query Arguments

    If you showed the author of RCP that function, they might be able to suggest how to use it with their code.

    It might also simply be that their code has to run after ours, as we use the standard query, but we overwrite the theme query.

    Anonymous
    #146934

    Hi,
    Working through this currently, thanks for the help so far.

    On https://www.designsandcode.com/documentation/search-filter-pro/search-results/infinite-scroll/

    you say at the bottom: “I will be writing a quick tutorial for the Archive (using WP 2016 theme) and Shortcode display methods over the next couple of weeks.”

    Is this tutorial available? The currently docs are a bit thin on how the display options work for the different display results settings, especially in the case of a large number of posts that are being scrolled through. I’m also wondering about performance issues with a large number of posts for infinite scrolling and the use case where you direct link to one of those posts with an anchor tag.

    Anonymous
    #146937

    Also could explain a little more about how the infinite scroll works?
    I gather you’re using WordPress pagination but the WP pagination settings (https://codex.wordpress.org/Pagination) don’t seem to have any effect.

    Is there any way to configure the number of results to fetch for each “page” of the infinite scroll?
    Is there any way to return the total number of results for the whole infinite scroll page? (like a pre-fetch query)

    Trevor
    #146978

    Hi

    The guide did not get written, I am sorry. Which Display results method are you using? For the Shortcode method, there is an exemplar results-infinite-scroll.php file in our plugin’s template folder. The contents of that file need to be used in either the custom results.php file you use or one numbered after the form, in a sub-folder of your child theme folder, as discussed here:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    The number to fetch each time is set by the General Results Per Page setting in the form.

    I think that code should answer your other questions as well.

    Anonymous
    #147096

    Hi,
    I’m already using a shortcode and the example template, numbered after the form. I get that.

    I don’t fully understand “Using the Post / Result Selector Option” and “Using the Infinite Scroll Container Option” and was after a more comprehensive working example illustrating how it works.

    >>The guide did not get written, I am sorry.

    You should write one to fully flesh out the documentation.

    >>The number to fetch each time is set by the General Results Per Page setting in the form.

    As in standard WP pagingation setting? I tested that yesterday and it didn’t appear to work, but I’ll test it again today. Is there a minimum amount it will fetch?

    Here’s the use case:
    http://wordpress-126708-362887.cloudwaysapps.com/all-tips/ is using the infinite scroll template.

    http://wordpress-126708-362887.cloudwaysapps.com/economy/ links to tips displayed on this page via the widget menu on the right. The infinite scroll page has been adjusted to add anchor tags so you can link directly to a tip post when you click on it from the right hand widget menu.
    Initially when you load the all tips page it loads as far as #7 from the top “Jun 5
    The geographical cracks in China’s economy” and will link directly ok, but any after that are not loaded so it will just end up at the top of the page.
    The “General Results Per Page setting” in WP settings does not seem to effect the amount of initial tips fetched.

    Anonymous
    #147100

    ah, I see you mean the S&FPro settings general tab “results per page”.
    Currently set at 20. I tested it at various settings and it does appear to work. ty!

Viewing 10 posts - 1 through 10 (of 31 total)