Forum

Thread tagged as: Question, Problem

Can Perch's custom search give results which go to the correct part of a page wi...

I've a page which has a multiple region which could get to having over a hundred entires. For this reason it is necessary to use pagination so that its not one long list. ie limited to 10 entries per page.

My question is whether its possible to have a search form where: when the user types in the search and if it occurs on page 6 for example of the page when paginated, then the link generated in the results goes to the dynamic url for the pagination eg

<a href="mypage.php?page=6"> rather than <a href="mypage.php"> as is default.

Thanks

John Robinson

John Robinson 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Not for pagination, but you can link to a page to show that item (it's in the region options).

Thanks, I have one more question regrading Search if its ok..

With Search functions can 'from-path' be written to specify more than one directory?

<?php
    $query = perch_get('q');    
    perch_content_search($query, array(
        'count'=>10,
        'from-path'=>'/products',
        //'from-path'=>'/corporate-information',      
      ));
?>

or ideally to disregard one directory?

This may totally not work, but you could try

'from-path'=>array('/products', '/somethingelse')
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think that'll work. I think it would be good to expand the flexibility of navigation restrictions. Feel free to post any suggestions (use the tag) so we can log them.