URGENT!!! exclude pages from search results

Permalink
Site launch in the morning and need a quick way to exclude a bunch of pages (over 100) from the search results... I tried excluding the parent pages but this doesn't effect the children
urgent help required

craftyCS
 
okhayat replied on at Permalink Reply
okhayat
1. Add a page check box attribute, with handle exclude_from_search_results.
2. Choose the pages to exclude.
3. Copy concrete/blocks/search/view.php to your /blocks/search/
4. Add the following line after line# 36:
<?php
$myPage = Page::getById($r->getID());
if ($myPage->getAttribute('exclude_from_search_results') == 1) continue;
?>

This will simply skip those pages.
craftyCS replied on at Permalink Reply
craftyCS
Hi this sounds interesting... I was wondering how to 'select all the pages' at once rather than having to go through all the pages add the check box etc? Like select the parent page for all the child pages and use that to set the exclude from search?