CTLModuleMaker: specifying a search result page
-
- Forum Members
- Posts: 42
- Joined: Wed Nov 10, 2004 10:17 pm
CTLModuleMaker: specifying a search result page
Hi,
I've created a categorised directory of organisations module using the excellent CTL Module Maker.
On most pages on my site, i have a search box for the module to allow people to search the directory.
However, by default, the module puts the results of the search where the module {tag} is on whatever page the user searched from. This means search results sometimes don't work, go in the wrong place, or look different depending which page you started your search, and usually end up crushed into the side bar of the website.
Is there a way to specify which page or page template should be used to display the results?
If this functionality isn't there, could you give me a clue how I might add it?
I've done custom code in this module to change behaviors, so I'm comfortable adding/editing code, but I'm not sure where to start in making this happen?
Many thanks for any help in advance,
Matt
I've created a categorised directory of organisations module using the excellent CTL Module Maker.
On most pages on my site, i have a search box for the module to allow people to search the directory.
However, by default, the module puts the results of the search where the module {tag} is on whatever page the user searched from. This means search results sometimes don't work, go in the wrong place, or look different depending which page you started your search, and usually end up crushed into the side bar of the website.
Is there a way to specify which page or page template should be used to display the results?
If this functionality isn't there, could you give me a clue how I might add it?
I've done custom code in this module to change behaviors, so I'm comfortable adding/editing code, but I'm not sure where to start in making this happen?
Many thanks for any help in advance,
Matt
Re: CTLModuleMaker: specifying a search result page
From what I understand, the detailpage parameter should do exactly that. Did you try it?
Pierre-Luc
Pierre-Luc
-
- Forum Members
- Posts: 42
- Joined: Wed Nov 10, 2004 10:17 pm
Re: CTLModuleMaker: specifying a search result page
Hi Pierre-Luc,plger wrote: From what I understand, the detailpage parameter should do exactly that. Did you try it?
Pierre-Luc
Thanks for your help.
I've tried that, but it doesn't seem to work for me.
The tag to generate the search form is in my home-page template, and looks like this...
{cms_module module="vcodirectory" what="organisation" action="search" searchmode="simple" detailpage="areas-of-interest"}
The tag on the page of alias areas-of-interest looks like this, and is placed in the {content} tag in a different template...
{cms_module module="vcodirectory" what="interest" detailpage="areas-of-interest"}
All of this looks alright to me, am I missing something that's stopping it working?
Has anyone else got search results from a CTLModuleMaker module to display on a page different to the page the search was performed on?
Matt
Re: CTLModuleMaker: specifying a search result page
Matt, you are right.
I tested on a module made with CTLMM 1.8.8.2 and the detailpage parameter in fact doesn't take me to the specified page, BUT, however, it sets the returnid towards the detailpage and makes the searchlinks going to that page.
The searchresults are displayed in the page where the search started.
Strange...
Bernd
I tested on a module made with CTLMM 1.8.8.2 and the detailpage parameter in fact doesn't take me to the specified page, BUT, however, it sets the returnid towards the detailpage and makes the searchlinks going to that page.
The searchresults are displayed in the page where the search started.
Strange...
Bernd
Re: CTLModuleMaker: specifying a search result page
Looks like a bug.
I don't have this here, but my working version of ctlmm has so much "half-done" modifications that it might be something I fixed in the past few months. Just to help me, could you edit the action.search.php function of your created module, search for: (it should have only one instance) and tell me if it's followed with $returnid or $linkreturnid
plger
I don't have this here, but my working version of ctlmm has so much "half-done" modifications that it might be something I fixed in the past few months. Just to help me, could you edit the action.search.php function of your created module, search for:
Code: Select all
$this->CreateFormStart($id, "search",
plger
Re: CTLModuleMaker: specifying a search result page
Hi Pierre-Luc.
Looks like:
Looks like:
Code: Select all
echo $this->CreateFormStart($id, "search", $returnid);
Re: CTLModuleMaker: specifying a search result page
Then changing $returnid to $linkreturnid should fix it.
(happy new year bernd!)
(happy new year bernd!)
Re: CTLModuleMaker: specifying a search result page
Happy new year to you too!
I just changed to $linkreturnid but it didn't fix it. Instead the detailpage was the frontpage with a URL like: http://www.mydomain.de/moduleinterface.php
Maybe it gets fixed in Matts case. I don't use the internal search in one of my projects right now. But later I will.
Speaking of which... how's V.2 going?
I just changed to $linkreturnid but it didn't fix it. Instead the detailpage was the frontpage with a URL like: http://www.mydomain.de/moduleinterface.php
Maybe it gets fixed in Matts case. I don't use the internal search in one of my projects right now. But later I will.
Speaking of which... how's V.2 going?
Re: CTLModuleMaker: specifying a search result page
v2.0 isn't going well, in fact I almost had to stop development since mid-december... the core is done, but the creation part isn't, and needless to say the language files and documentation is seriously lacking... but please keep hope, because it'll make a lot of things possible!
Just to make sure, try replacing the $returnid (or $linkreturnid) with this:
in other words :
If it doesn't work, send me a copy of your action.search.php.
Pierre-Luc
Just to make sure, try replacing the $returnid (or $linkreturnid) with this:
Code: Select all
isset($params["detailpage"])?$this->get_pageid($params["detailpage"]):$returnid
Code: Select all
echo $this->CreateFormStart($id, "search", isset($params["detailpage"])?$this->get_pageid($params["detailpage"]):$returnid);
Pierre-Luc
Re: CTLModuleMaker: specifying a search result page
Hey, that's the solution. Works great now.
I put it in my snippet collection for use with the older modules.
And for v 2.0... take your time and do it thoroughly.
If you need someone to test anything... you know where to find me.
Bernd
I put it in my snippet collection for use with the older modules.
And for v 2.0... take your time and do it thoroughly.
If you need someone to test anything... you know where to find me.
Bernd