We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Utilize perch_content_search with array of content, or exclude a singular path/p...
Today I have a new issue that I'm researching. In that my client is asking me to remove a section of their site from the perch_content_search's consideration due to it being password protected. After reviewing the perch_content_search documentation, and the change log from November 17th of last year I'm left a little confused on how to complete this. The only usage example I see in the grabaperch docs site (https://docs.grabaperch.com/functions/search/perch-content-search/) is:
<?php $query = perch_get('q'); perch_content_search($query, array( 'count'=>5, 'from-path'=>'/articles', 'excerpt-chars'=>300, 'template'=>'my_template.html' )); ?>
Am I to assume that the correct way to use the array functionality is to write it like this?
<?php $query = perch_get('q'); perch_content_search($query, array( 'count'=>5, 'from-path'=>array('/articles', '/news', '/blog'), 'excerpt-chars'=>300, 'template'=>'my_template.html' )); ?>
Secondly because the client is asking me to remove a particular section from search, is there a way of either marking it, or changing the search function to pass over that folder short of exhaustively listing all the other content paths on the site? Strangely enough, the one they want to remove is sheltered inside a folder that I suspect they want searchable.
Is there a way to say that anything that matches that path should be ignored? It would make the difference between writing 1 line and writing 30 lines in this case.
Want to reply to this thread?Login with Perch