Forum
page specific search function on multiple pages.
Im looking to have multiple search functions on 3 pages of a clients site. However I only want to search the content on that certain page. I looked up the "from-path" php function, but can't seem to get the function working. I have the following markup.
<?php $query = perch_get('q'); perch_content_search($query, array( 'count'=>10, 'excerpt-chars'=>0, 'hide-default-doc'=>false, 'from-path'=>"/realtors.php", )); ?>
I only want the search function to look up content on the realtors.php page.? Any help would be appreciated. Without the 'from-path' function. the search function works great, however it pulls content from all over the site.
Cheers, Matt
Sorry, Here is the structured code.
from-path needs to be a directory, so if your realtors.php was actually /realtors/index.php you could use from-path=>"/realtors"
Still not working. My document is now located in a realtors folder in the root folder
ex. /realtors/index.php
If you add debug to that page what does it output?
https://solutions.grabaperch.com/development/how-do-i-debug-problems
Is anything on your site working? Those look like pretty fundamental configuration errors.
Can you post your diagnostics report? You should have been asked for that when creating your post.
I accidentally deleted some files yesterday.
My search function is working, however it says no results found when I state the 'from path' here is an example of two screenshots.
The search works perfectly when no path is selected, however when the path is defined, no results could be found?
Here is my mark up.
Any help is appreciated. Here is my debug message.
Have you replaced the files you deleted?