Where or {continue} ?

6 posts by 2 authors in: Forums > CMS Builder
Last Post: March 2, 2010   (RSS)

Re: [Perchpole] Where or {continue} ?

By Chris - March 2, 2010

Hi Perchpole,

Can this be solved with "rootCategoryNum"?

$numOfParentCategory = 123;

list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'category',
'rootCategoryNum' => $numOfParentCategory,
));


Does that help? Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Where or {continue} ?

By Perchpole - March 2, 2010

Hi, Chris -

Thanks for your note. The short answer is, Yes, it could work but I'd prefer to use a solution that could be applied, automatically, to every eventuality - rather than something that needs to be tailored to suit every instance.

I thought there would be a cunning way to use some of the preset arguments to arrive at a solution!

:0)

Perch

Re: [Perchpole] Where or {continue} ?

By Chris - March 2, 2010

Hi Perch,

We can generalize the above solution if we can figure out the "num" of the parent category to display.

How does the page that's displaying this list of categories know which parent category it wants to display? Is the num passed in the query string or do you need to search some fields to determine which category?

If you can give me a specific example of how you want this to work, I can show you how to generalize it.
All the best,
Chris

Re: [chris] Where or {continue} ?

By Perchpole - March 2, 2010

Hi, Chris -

The number would come direct from the category num - which presumably would be at the end of the URL.

:o)

Perch

Re: [Perchpole] Where or {continue} ?

By Chris - March 2, 2010

Hi Perch,

Does this solve the problem then?

$numOfParentCategory = getNumberFromEndOfUrl();

list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'category',
'rootCategoryNum' => $numOfParentCategory,
));


Please let me know if you have any questions.
All the best,
Chris