CTLModuleMaker: specifying a search result page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Matt Jason H
Forum Members
Forum Members
Posts: 42
Joined: Wed Nov 10, 2004 10:17 pm

CTLModuleMaker: specifying a search result page

Post by Matt Jason H »

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
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: CTLModuleMaker: specifying a search result page

Post by plger »

From what I understand, the detailpage parameter should do exactly that. Did you try it?
Pierre-Luc
Matt Jason H
Forum Members
Forum Members
Posts: 42
Joined: Wed Nov 10, 2004 10:17 pm

Re: CTLModuleMaker: specifying a search result page

Post by Matt Jason H »

plger wrote: From what I understand, the detailpage parameter should do exactly that. Did you try it?
Pierre-Luc
Hi 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
klenkes
Power Poster
Power Poster
Posts: 307
Joined: Mon Sep 08, 2008 9:43 am

Re: CTLModuleMaker: specifying a search result page

Post by klenkes »

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
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: CTLModuleMaker: specifying a search result page

Post by plger »

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:

Code: Select all

$this->CreateFormStart($id, "search",
(it should have only one instance) and tell me if it's followed with $returnid or $linkreturnid
plger
klenkes
Power Poster
Power Poster
Posts: 307
Joined: Mon Sep 08, 2008 9:43 am

Re: CTLModuleMaker: specifying a search result page

Post by klenkes »

Hi Pierre-Luc.
Looks like:

Code: Select all

	echo $this->CreateFormStart($id, "search", $returnid);
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: CTLModuleMaker: specifying a search result page

Post by plger »

Then changing $returnid to $linkreturnid should fix it.
(happy new year bernd!)
klenkes
Power Poster
Power Poster
Posts: 307
Joined: Mon Sep 08, 2008 9:43 am

Re: CTLModuleMaker: specifying a search result page

Post by klenkes »

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?
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: CTLModuleMaker: specifying a search result page

Post by plger »

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:

Code: Select all

isset($params["detailpage"])?$this->get_pageid($params["detailpage"]):$returnid
in other words :

Code: Select all

	echo $this->CreateFormStart($id, "search", isset($params["detailpage"])?$this->get_pageid($params["detailpage"]):$returnid);
If it doesn't work, send me a copy of your action.search.php.
Pierre-Luc
klenkes
Power Poster
Power Poster
Posts: 307
Joined: Mon Sep 08, 2008 9:43 am

Re: CTLModuleMaker: specifying a search result page

Post by klenkes »

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
Post Reply

Return to “Modules/Add-Ons”