On Lun, 15 Agosto 2011 3:26, Dave wrote:
> On Thu, Aug 11, 2011 at 10:13 AM, Rocco Scappatura
> <[email protected]> wrote:
>> I would like to further customize the template of my blog inserting a
>> 'Related entries' to an entry just like the following:
>>
>> http://rollerweblogger.org/roller/entry/welcome_new_roller_committer_shelan
>>
>> and a few tags associated with an entry just as reported in the link
>> above.
>>
>> Could I get the velocity code for this two features?
>
> Here's the code that I use:
>
>     <h3>Related entries</h3>
>     <p class="details">Below are the most recent entries in the category
>     <b>$model.weblogEntry.category.name</b>, some may be related to
> this entry.</p>
>     #set($recentInCat =
> $model.weblog.getRecentWeblogEntries($model.weblogEntry.category.name,
> 20))
>     <ul>#foreach($recentEntry in $recentInCat)
>         <li class="entryLink"><a
> href="$recentEntry.permalink">$recentEntry.title</a></li>
>     #end</ul>
>
> Hope that helps.

Thanks Dave,

but this is not exactly what I would like to implement. Infact, I would
like to show at bottom of each entry a list of all entries on my blog that
share at least one tag with the current (indipendently of category).

I tried to add the following code lines to the _day template :

     <h2>recent Post</h2>

    #foreach( $entry_tags in $entry.tags )
       #foreach( $matching_entry in $entries )
         #if ($entry_tags in $entry_tags.tags)
            <li class="rFolderItem">
               <a href="$entry_tags.permalink" title="$entry_tags.title"
class="rBookmark1">$entry_tags.title</a>
            </li>
         #end
       #end
    #end


But it does not clearly work just beacause of an error syntax:

         #if ($entry_tags in $entry_tags.tags)

But how I verify that a tag of current entry is also a tag of an entry of
list of entries that I'm reading?

I know that this is a matter of velocity language but any help will be
appreciate!

Thanks,

> - Dave
>

rocsca

Reply via email to