Member
Member
altert   2010-08-22, 16:52
#1
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
Member
Member
altert   2010-08-22, 17:50
#2
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
Administrator
Administrator
acrylian   2010-08-22, 17:57
#3
Looks good, but I am not sure you really need to use`zenpage_setup_page($homepage[titlelink]);`. Just use the normal object setup like
`
$page = new ZenpagePage($homepage[titlelink]);
$page->getTitleLink();
`
for the following list stuff. )
Member
Member
altert   2010-08-22, 21:02
#4
thanks!

in fact I think for my purposes I don't even need to create page object
Member
Member
altert   2012-07-01, 15:05
#5
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
Administrator
Administrator
acrylian   2012-07-01, 15:36
#6
See the related_items plugin on the 1.4.3 beta for an example.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.