Page 1 of 1

Cataloger - displaying random

Posted: Sun Jun 25, 2006 2:50 pm
by mikemcvey
Hi I am trying to use the following which I took from the help section for the module..

I think it is right but I just can't get it to work.

{cms_module module='Cataloger' action='random' sub_template='Item-Table-based'}

Any ideas or is this a new bug that has surfaced since .13

Mike

Re: Cataloger - displaying random

Posted: Sun Jun 25, 2006 10:04 pm
by mikemcvey
Hi,

I am really stuck on this!
I have tracked down the problem to be somewhere around this line in the action.random.php file

Code: Select all

echo $this->ProcessTemplateFromDatabase($this->getTemplateFromAlias($params['sub_template']));
It doesn seem to be able to read the tpl??

Any ideas gow to hard code a value?

Mike

Re: Cataloger - displaying random

Posted: Mon Jun 26, 2006 12:08 am
by mikemcvey
I have actually made a hack to get this to work by using echos rather than passing the vars to a smarty template.

Seems this line is wrong

getTemplateFromAlias($params['sub_template'])

However for th life od me I can't get it to read a tpl! I even tried hard coding in the value with no luck.
If someone could inform me how to pass the values to a smarty I would be very happy :)

Mike

Re: Cataloger - displaying random

Posted: Mon Jun 26, 2006 2:48 am
by Dr.CSS
have you tried putting .tpl on the end...

{cms_module module='Cataloger' action='random' sub_template='Item-Table-based.tpl'}

Re: Cataloger - displaying random

Posted: Wed Feb 21, 2007 6:37 pm
by vaughnt
I believe you need to specify a category template, not an item template, for one thing... 

{cms_module module='Cataloger' action='random' sub_template='Category-Table-based'}

..and for another, it seems to have a bug doing random where the "count" parameter is required, and it's value must be greater than one.

Works:
{cms_module module='Cataloger' action='random' sub_template='Category-Table-based' count='2'}
Gives me two randomized products, displayed using my category template, as desired.

Breaks:
{cms_module module='Cataloger' action='random' sub_template='Category-Table-based' count='1'}
Gives seven blank items, nothing filled in. Just the template html output 7 times.

Pity, I really want just ONE random image on my homepage.

Re: Cataloger - displaying random

Posted: Fri Dec 05, 2008 12:13 pm
by Fedork
Please tell me how to make the random withdrawal of objects from the catalog on all pages of site?