custom search for pages in index.php

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

Comments

  • 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
  • acrylian Administrator, Developer
    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. )
  • thanks!

    in fact I think for my purposes I don't even need to create page object
  • altert Member
    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
  • acrylian Administrator, Developer
    See the related_items plugin on the 1.4.3 beta for an example.
Sign In or Register to comment.