Hi there,
I am struggling to work out something that i know should be really simple but its just not working out for me!
I have set up images manager and i need to be able to search on the user side only through the image pages that get created with images manager, the thing is I need it to search by a page feild called imageTags.
Here is the set up as I dont think i am explaining myself too well!
images
Category 1
Image 1 -> this has a page list multiple select that is selected from imageTags
Image 2 " " "
Image 3 " " "
imageTags
tag1
tag2
tag3
So when searching it needs to output an image page based on a search through that pages imageTags!
Here is what I have But its probably far off!
<?php
$out = '';
if($q = $sanitizer->selectorValue($input->get->q)) {
$input->whitelist('q', $q);
$matches = $pages->find("image.imageTags%=$q, limit=20");
$count = count($matches);
if($count) {
$out .= "<h2>Found $count pages matching your query:</h2>" .
}
} else { $out .= "<h2>Sorry, no results were found.</h2>"; } } else { $out .= "<h2>Please enter a search term in the search box (upper right corner)</h2>"; }
include("./head.inc");
echo $out;
include("./foot.inc");
And the search form is this:
<form class="search-form" id='search_form' action='<?php echo $config->urls->root?>search/' method='get'>
<input type='text' name='q' id='search_query' placeholder="Search" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Search'" value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES, 'UTF-8'); ?>' />
</form>
Any help is greatly appreciated so a big thanks in advance!
Ollie