List Info

Thread: Re: associating multiple related stories to a given story




Re: associating multiple related stories to a given story
user name
2008-04-09 09:26:03
Hi ho,

On 8-Apr-08, at 6:31 AM, Rajesh krishna Mallah wrote:
> Hi,
>
> The "Related Stories" and "Related
Story" Element Types were useful.
> However i could not find related_story.mc file (did you
mean  
> story_list.mc?)


Nope. Meant the related_story.mc template.    If it's
not there,  
you probably haven't created it yet.  


> Hence i did below in my template.
> I hope it  is appropriate and efficient.


Looks efficient to me. Doesn't Perl translate to "many
ways to get  
things done?"

Phillip.


>
>
> regds
> mallah.
>
> --- see_also.mc ------
>
> <%perl>
> my $container =   $element->get_container(
'related_stories' ) ;
> return unless defined $container;
> my stories = map {  $_->get_related_story() }
> $container->get_elements('related_story');
> return unless (stories);
> </%perl>
> <br>
> <b>SEE ALSO</b>
> <ul>
> % foreach my $s (stories) {
> <li> <a href="<% $s->get_uri()
%>"><% $s->get_name()
%></a></li>
> %}
> </ul>
>
> ----------  end -----------------
> On Mon, Apr 7, 2008 at 10:07 PM, Phillip Smith
> <phillipcommunitybandwidth.ca> wrote:
>>
>> Hi there Mallah,
>>
>> That's exactly the kind of thing that a
"related story" sub-element  
>> can be
>> used for.
>>
>> You'll need a related_story.mc template to handle
the display of your
>> related stories.
>>
>> Best,
>>
>> Phillip.
>>
>>
>>
>> On 7-Apr-08, at 7:44 AM, Rajesh krishna Mallah
wrote:
>>
>>> Hi,
>>>
>>>
>>> I would want to know how i can associate
multiple stories as
>>> related story to a given story.
>>>
>>> Eg in Story:
>>> http://news.bbc.co.uk/2/hi/uk_news/england/bond/73339
80.stm
>>> There are multiple stories under "SEE
ALSO" in the RHS column
>>> can anyone please tell me if "related
story" is meant for this
>>> kind of use ?
>>>
>>>
>>> regds
>>> mallah.
>>>
>>
>> --
>> Phillip Smith,
>> Simplifier of Technology
>> Community Bandwidth
>> http://www.community
bandwidth.ca
>>
>> Don't miss the Social Tech Training:
>> www.marsdd.com/socialtechtraining
>> June 22-24, 2008 in Toronto
>>
>>

--
Phillip Smith,
Simplifier of Technology
Community Bandwidth
http://www.community
bandwidth.ca



Re: associating multiple related stories to a given story
user name
2008-04-09 11:32:17
On Wed, Apr 09, 2008 at 10:26:03AM -0400, Phillip Smith
wrote:
> 
> Hi ho,
> 
> On 8-Apr-08, at 6:31 AM, Rajesh krishna Mallah wrote:
> >Hi,
> >
> >The "Related Stories" and "Related
Story" Element Types were useful.
> >However i could not find related_story.mc file (did
you mean  
> >story_list.mc?)
> 
> 
> Nope. Meant the related_story.mc template.    If it's
not there,  
> you probably haven't created it yet.  

? related_story.mc is distributed w/ my copy of 1.10.3

> >Hence i did below in my template.

For the record, here's a copy of the distributed copy of
"related_story.mc" I have:

<!-- Start "Related Story" -->
% my $rel_story = $element->get_related_story;
<b>Title:</b>&nbsp;
<% $element->get_value('alternate_title') ||
$rel_story->get_title %><br />
<b>Teaser:</b>&nbsp;
<% $element->get_value('alternate_teaser') ||
$rel_story->get_description %><br />
<!-- End "Related Story" -->


> >I hope it  is appropriate and efficient.
> 
> 
> Looks efficient to me. Doesn't Perl translate to
"many ways to get  
> things done?"
> 
> Phillip.
> 
> 
> >
> >
> >regds
> >mallah.
> >
> >--- see_also.mc ------
> >
> ><%perl>
> >my $container =   $element->get_container(
'related_stories' ) ;
> >return unless defined $container;
> >my stories = map {  $_->get_related_story() }
> >$container->get_elements('related_story');
> >return unless (stories);
> ></%perl>
> ><br>
> ><b>SEE ALSO</b>
> ><ul>
> >% foreach my $s (stories) {
> ><li> <a href="<% $s->get_uri()
%>"><% $s->get_name()
%></a></li>
> >%}
> ></ul>
> >
> >----------  end -----------------
> >On Mon, Apr 7, 2008 at 10:07 PM, Phillip Smith
> ><phillipcommunitybandwidth.ca> wrote:
> >>
> >>Hi there Mallah,
> >>
> >>That's exactly the kind of thing that a
"related story" sub-element  
> >>can be
> >>used for.
> >>
> >>You'll need a related_story.mc template to
handle the display of your
> >>related stories.
> >>
> >>Best,
> >>
> >>Phillip.
> >>
> >>
> >>
> >>On 7-Apr-08, at 7:44 AM, Rajesh krishna Mallah
wrote:
> >>
> >>>Hi,
> >>>
> >>>
> >>>I would want to know how i can associate
multiple stories as
> >>>related story to a given story.
> >>>
> >>>Eg in Story:
> >>>http://news.bbc.co.uk/2/hi/uk_news/england/bond/73339
80.stm
> >>>There are multiple stories under "SEE
ALSO" in the RHS column
> >>>can anyone please tell me if "related
story" is meant for this
> >>>kind of use ?
> >>>
> >>>
> >>>regds
> >>>mallah.
> >>>
> >>
> >>--
> >>Phillip Smith,
> >>Simplifier of Technology
> >>Community Bandwidth
> >>http://www.community
bandwidth.ca
> >>
> >>Don't miss the Social Tech Training:
> >>www.marsdd.com/socialtechtraining
> >>June 22-24, 2008 in Toronto
> >>
> >>
> 
> --
> Phillip Smith,
> Simplifier of Technology
> Community Bandwidth
> http://www.community
bandwidth.ca
> 
> 

-- 

Brad Harder,
Method Digital Logic
http://www.methodlogic.net


[1-2]

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