Cataloger - displaying random

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Cataloger - displaying random

Post 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
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: Cataloger - displaying random

Post 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
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: Cataloger - displaying random

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Cataloger - displaying random

Post by Dr.CSS »

have you tried putting .tpl on the end...

{cms_module module='Cataloger' action='random' sub_template='Item-Table-based.tpl'}
vaughnt
Forum Members
Forum Members
Posts: 82
Joined: Tue Jun 13, 2006 2:05 pm

Re: Cataloger - displaying random

Post 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.
--
My photography: http://vaughnsphotoart.com
Festiva Resorts: http://www.festiva.travel
User avatar
Fedork
Forum Members
Forum Members
Posts: 23
Joined: Wed Nov 19, 2008 11:32 am

Re: Cataloger - displaying random

Post by Fedork »

Please tell me how to make the random withdrawal of objects from the catalog on all pages of site?
Post Reply

Return to “Developers Discussion”