ZenphotoCMS Forum
custom search for pages in index.php - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: custom search for pages in index.php (/thread-7516.html)



custom search for pages in index.php - altert - 2010-08-22

Hello

For my theme I want to print some pages tagged with specific tag on homepage. Is it possible to initiate search from inside the index.php?

Thanks,
Alexey




custom search for pages in index.php - altert - 2010-08-22

After some digging in docs I was able to do it that way (specific tag here is "homepage")
`

$searchobject = new SearchEngine();

$searchstring=Array("homepage");

$homepages=$searchobject->searchFieldsAndTags($searchstring, "zenpage_pages", "tags");

foreach($homepages as $homepage) {

zenpage_setup_page($homepage[titlelink]);

`
etc.
So the question is probably closed. Is it the best way to do it or I missed something here?

Thanks




custom search for pages in index.php - acrylian - 2010-08-22

Looks good, but I am not sure you really need to usezenpage_setup_page($homepage[titlelink]);. Just use the normal object setup like
$page = new ZenpagePage($homepage[titlelink]); $page->getTitleLink();
for the following list stuff. )




custom search for pages in index.php - altert - 2010-08-22

thanks!

in fact I think for my purposes I don't even need to create page object




custom search for pages in index.php - altert - 2012-07-01

Hello,

Now that the method is protected and that solution stopped working, is there a way to generate a search inside some pages?

Thanks,
Alexey




custom search for pages in index.php - acrylian - 2012-07-01

See the related_items plugin on the 1.4.3 beta for an example.