List Info

Thread: RE: nested story templates




RE: nested story templates
user name
2007-02-28 16:16:18
>I'm not sure I follow, but if what you want is to
execute an event  
>story's template from within another stories, template,
you just have  
>to set the $story global.
>
>   for my $rel_event
($element->get_elements('event')) {
>       my $event = $rel_event->get_related_story;
>       local $story = event;
>       $burner->display_element($event);
>   }

>Note that $story is set to the event only for the
duration of the  
>`for` block, and is automatically reset to the original
story outside  
>of the block. That's the beauty of `local`.

Hmmm.... When I try this method, I get the error:

Can't locate object method "is_container" via
package
"Bric::Biz::Asset::Business::Story"




Re: nested story templates
user name
2007-02-28 17:16:20
On Feb 28, 2007, at 14:16, Beaudet, David P. wrote:

> Hmmm.... When I try this method, I get the error:
>
> Can't locate object method "is_container" via
package
> "Bric::Biz::Asset::Business::Story"

Sorry, make that:

   for my $rel_event ($element->get_elements('event')) {
       local $story = $rel_event->get_related_story;
       $burner->display_element($rel_event);
   }

Best,

David


RE: nested story templates
user name
2007-02-28 22:00:22
 
Thanks David.  That seems to be working now.  However, I'm
getting a 32-levels deep recurrence error in a different
template now.  Basically, I'm fetching a list of stories
with the Bric API and I want to render each one in the list
using display_element.  What's the best way to fetch the
associated container element for each of the stories in the
list?

________________________________

From: David E. Wheeler [mailto:davidkineticode.com]
Sent: Wed 2/28/2007 6:16 PM
To: userslists.bricolage.cc
Subject: Re: nested story templates



On Feb 28, 2007, at 14:16, Beaudet, David P. wrote:

> Hmmm.... When I try this method, I get the error:
>
> Can't locate object method "is_container" via
package
> "Bric::Biz::Asset::Business::Story"

Sorry, make that:

   for my $rel_event ($element->get_elements('event')) {
       local $story = $rel_event->get_related_story;
       $burner->display_element($rel_event);
   }

Best,

David



Re: nested story templates
user name
2007-03-01 12:07:51
On Feb 28, 2007, at 20:00, Beaudet, David P. wrote:

> Thanks David.  That seems to be working now.  However,
I'm getting  
> a 32-levels deep recurrence error in a different
template now.   
> Basically, I'm fetching a list of stories with the Bric
API and I  
> want to render each one in the list using
display_element.  What's  
> the best way to fetch the associated container element
for each of  
> the stories in the list?

   $list_story->get_element

Best,

David

[1-4]

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