List Info

Thread: Re: Too many Bric::Biz::Category objects found.




Re: Too many Bric::Biz::Category objects found.
user name
2007-09-18 12:59:39
On Sep 17, 2007, at 09:58, Matt Rolf wrote:

> http://www.d
enison.edu/offices/computing
>
> We build our search tool at the upper right using an
array of the  
> category names.

If you want just the top-level categories, I would just do
something  
like:

   my $root_id = Bric::Biz::Category->list_ids({
     site_id => $story->get_site_id,
     uri     => '/',
   })->[0];

   my cats = Bric::Biz::Category->list({
     site_id   => $story->get_site_id,
     parent_id => root_id,
   });

Note that I'm assuming that you're searching only for
categories in  
the current site.

> Here's some more complete code from that template.  It
is a utility  
> template that gets called after the body tag in the
autohandler.   
> The death occurs when we're finding the name of the
secondary  
> category.
>
> <!-- INCLUDE for top nav search - dont forget to use
%2F for  
> slashes! -->
> <%perl>
>
> #build the subcat from the categories array
> my $secondaryCat = '';
> my $n = 0;
> foreach (categories){

Where does categories come from?

Best,

David


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )