Page search
14 posts by 2 authors in: Forums > CMS Builder
Last Post: January 16, 2008 (RSS)
By Djulia - January 14, 2008 - edited: January 14, 2008
I have a problem with the creation of a menu on my search.php page.
Here my menu :
Page1
Page2
Page3
Page4
When the user makes a research, the menu gives only the value of the found recording.
Thus, if the found recording is page3, the menu will have only page3.
You have an idea ?
Thank you for your assistance.
Djulia
Re: [Djulia] Page search
By Dave - January 14, 2008
What happens is the viewers get the search keywords from the url. So if you have mypage.php?title_keyword=house then all the viewers on the page will only show records matching that.
You can tell a viewer to ignore the keywords and show only specified records by specifying your own where option. This is the WHERE statement that is used in the MySQL query. It could be 'num = 3' or 'title = "something"' or to show everything all the time '1' since that's always true.
To show all the menu options all the time try this:
$options['where'] = '1';
Hope that helps.
interactivetools.com
Re: [Dave] Page search
By Djulia - January 14, 2008
In fact, I use this code to obtain the menu on the page of search.
<!-- show menu -->
<ul id="navlist">
<?php
foreach ($listRows as $menuRecord):
$pageLink = "/.../{$menuRecord['filename']}/";
$isSelected = $requestedPage == $menuRecord['filename'];
?>
<?php if ($isSelected): ?>
<li><a href="<?php echo $pageLink; ?>"><?php echo $menuRecord['title'] ?></a></b></li>
<?php else: ?>
<li><a href="<?php echo $pageLink; ?>"><?php echo $menuRecord['title'] ?></a></li>
<?php endif ?>
<?php endforeach ?>
</ul>
<!-- /show menu -->
But if I place "where" on 1, the search does not function.
All the recordings are shown.
An idea ?
Thank you for your assistance.
Djulia
Re: [Djulia] Page search
By Dave - January 14, 2008
Let me research that a little bit and get back to you with the best solution.
Can you attach your schema file so I can recreate it locally? It's /data/schema/demo.ini.php
interactivetools.com
Re: [Dave] Page search
By Djulia - January 14, 2008 - edited: January 14, 2008
There is an error 404 which is caused by admin.php :
"admin.php?menu=demo&action=edit&num=5"
Error : /tinymce3/plugins/fullscreen/editor_plugin.js
Djulia
Re: [Djulia] Page search
By Dave - January 15, 2008
Try this for showing your menu all the time:
<!-- show menu -->
<ul id="navlist">
<?php
require_once "../lib/viewer_functions.php";
$options = array();
$options['tableName'] = 'demo';
$options['titleField'] = 'title';
$options['viewerUrl'] = 'demoPage.php';
$options['perPage'] = '9999';
$options['orderBy'] = 'title';
$options['pageNum'] = '1';
$options['where'] = '1';
list($searchRows, $searchDetails) = getListRows($options);
foreach ($searchRows as $menuRecord):
$menuLink = "{$_SERVER['PHP_SELF']}/{$menuRecord['filename']}/";
$isSelected = $requestedPage == $menuRecord['filename'];
?>
<?php if ($isSelected): ?>
<li><a href="<?php echo $menuLink; ?>"><?php echo $menuRecord['title'] ?></a></b></li>
<?php else: ?>
<li><a href="<?php echo $menuLink; ?>"><?php echo $menuRecord['title'] ?></a></li>
<?php endif ?>
<?php endforeach ?>
</ul>
<!-- /show menu -->
>There is an error 404 which is caused by admin.php
>Error : /tinymce3/plugins/fullscreen/editor_plugin.js
Thanks, we'll include those in the next version and I've attached them to this post. You can upload them to /tinymce3/plugins/fullscreen/
Hope that helps!
interactivetools.com
Re: [Dave] Page search
By Djulia - January 15, 2008
But, I have another problem with the link
/search.php?content_keyword=un&page=2
It does not function.
It always seems to give the first found recording.
&page=2 is the good value ?
Thank you for your answer.
Djulia
Re: [Djulia] Page search
By Dave - January 15, 2008
$options['pageNum'] = '';
Try change the pageNum value and see if that helps.
interactivetools.com
Re: [Dave] Page search
By Djulia - January 15, 2008
But, there is a last problem.
The menu is not available on page 2.
I do not manage to find the origin of my problem in my file.
You have an idea ?
Djulia