Forums / Setup & design / How to direct the searchresult to the right page/place

How to direct the searchresult to the right page/place

Author Message

Tor Olav Steinsvoll

Saturday 02 August 2003 10:17:19 am

Hi. I hope someone can help me. I have put a search-field on top of my frontpage and the search works just fine, both ways, simple and advanced. I get the results that I want.

What my problem is: How can I direct the results of the search to the right page/place? The result of the search brakes up my page and my menu on the left side disappears.

(I have not created my own copies of search.tpl and adv....search.tpl. I use the ones that comes with the installation.)

Regards from Tor Olav

David Jones

Friday 08 December 2006 3:02:49 am

I need the answer to this question.

Does anybody know?

Jon Staines

Friday 08 December 2006 8:22:04 am

If it is just stopping the menu from disappearing then I had the same problem. If there are further page breaks then can you explain how it broke?

For the missing menu on a search page I've used 2 different solutions depending on the site. If your menu is always the same, ie only one level or you use flyout menus so always have to load the whole thing then I used something like (where xxxxx is the root of the tree):

    {let root_node=fetch( content, node, hash( node_id, 2 ) )
         menuitems=fetch( content, list, hash( parent_node_id, xxxxx,
                                               class_filter_type, include,
                                               class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                                               sort_by, $root_node.sort_array ) )}
{* MOZILLA MENU *}
<div id="leftmenu-design">
    <ul class="flyout1" id="nav-flyout">
    {section var=menu loop=$menuitems}

The li entry goes here, or have a further lookup based on the node id of this entry if you want more levels for flyouts.

    {/section}
    </ul>
</div>

If your design drops into sublevels of the menu so you need it to know the what node you are in for pages other than the search, then try:

{let docs=treemenu( $module_result.path,
                    is_set( $module_result.node_id )|choose( 2, $module_result.node_id ),
                    ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                    0, 5 )
                    depth=1
                    last_level=0}
        {if eq($:docs|count(),0)}
          {let root_node=fetch( content, node, hash( node_id, 2 ) )
               menuitems=fetch( content, list, hash( parent_node_id, 2,
                                                     class_filter_type, include,
                                                     class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                                                     sort_by, $root_node.sort_array ) )}
            {section var=menu loop=$menuitems}
              <li class="menu-level-0"><a href={$menu.url_alias|ezurl}>{$menu.name}</a></li>
            {/section}
        {else}
          {section var=menu loop=$:docs last-value}

Normal menu template code in here

          {/section}
        {/if}
{/let}

In this, it checks if there would be results to form the tree and if it fails, a search page, then it just loads the default tree starting from node 2.

Hope this points you in the right direction.

eZ debug

Timing: Jan 31 2025 01:14:52
Script start
Timing: Jan 31 2025 01:14:52
Module start 'content'
Timing: Jan 31 2025 01:14:52
Module end 'content'
Timing: Jan 31 2025 01:14:53
Script end

Main resources:

Total runtime0.2161 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.1719370.2734
Module start 'content' 0.00690.0140 958.44531,005.6250
Module end 'content' 0.02100.1951 1,964.07033,893.9141
Script end 0.2160  5,857.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00452.0979200.0002
Check MTime0.00140.6328200.0001
Mysql Total
Database connection0.00080.350710.0008
Mysqli_queries0.099646.09511410.0007
Looping result0.00160.73711390.0000
Template Total0.194790.110.1947
Template load0.00070.336410.0007
Template processing0.194089.775410.1940
Override
Cache load0.00050.235510.0005
Sytem overhead
Fetch class attribute can translate value0.00251.152710.0025
XML
Image XML parsing0.00030.129510.0003
General
dbfile0.028012.9673200.0014
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs