This seems to work if I understand the question correctly, ie you want to display only the results of a search based on a word/phrase contained in a user-defined content block.
Firstly, create a MenuManager template called 'getalias'. It doesn't need to contain anything, we only want the node list. Just to have something in the content area, you can leave {if $count > 0}{/if}.
Next, modify the Search result template as follows:
Code: Select all
{cms_module module=MenuManager template=getalias}
<h3>{$searchresultsfor} "{$phrase}"</h3>
{if $itemcount > 0}
<ul>
{foreach from=$results item=entry}
{foreach from=$nodelist item=node}
{if $entry->url eq $node->url}
{capture assign=blockcontent}{$cgsimple->get_page_content($node->alias,'name_of_your_content_block')}{/capture}
{if $blockcontent|strpos:$phrase !== false}
<li>
{$entry->title} - <a href="{$entry->url}">{$entry->urltxt}</a>
({$entry->weight}%)
</li>
{/if}
{/if}
{/foreach}
{/foreach}
</ul>
<p>
{$timetaken}: {$timetook}
</p>
{else}
<p>
<strong>{$noresultsfound}</strong>
</p>
{/if}
How it works:
1. We retrieve the nodelist which contains the page alias and also conveniently, the page URL.
2. We iterate through the search results and compare the search entry URL with the nodelist URL
3. When a match is found, we retrieve the particular content block using CGSimpleSmarty with the corresponding $node->alias
4. Next, we search the content block for the search phrase {$phrase}
5. If a match is found, it outputs the result or else moves onto the next search result.
Please Note: CGSimpleSmarty must be installed.
hth
psy