roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Odelya YomTov" <ode...@jpost.com>
Subject RE: Tags
Date Thu, 19 Feb 2009 12:57:09 GMT
Hi!
I understood the idea behind separating front page and tags index.
But if I separate it, how can I use the $site object in a tags index that is
not a front page? I have Enable aggregated site-wide frontpage.

Odelya 

-----Original Message-----
From: Dave [mailto:snoopdave@gmail.com] 
Sent: Wednesday, February 18, 2009 4:47 PM
To: user@roller.apache.org
Subject: Re: Tags

On Tue, Feb 17, 2009 at 1:00 AM, Odelya YomTov <odelya@jpost.com> wrote:
> Now, when I point it to my site + /tags/harris it shows the tags.
> but when it's on my site only

I'm not sure I understand.

Is the page where you call $site.getWeblogEntriesPager(365, 30) a
tagsIndex page?

Do you have "Enable aggregated site-wide frontpage" enabled?


> it shows the last 30 entries with I don't want to display.

You can change 30 to whatever number you want, or -1 for no limit (not
advisable).


> I want to display the titles only in case that the url is with
/tags/harris
> etc. How can I distinguish if the user from clicking on a tag, or if it's
simply
> the main page?

You should have a separate Weblog page as the main page of your site
and a tagsIndex page for displaying entries in one tag.

Hope that helps...

- Dave



> -----Original Message-----
> From: Dave [mailto:snoopdave@gmail.com]
> Sent: Monday, February 16, 2009 10:03 PM
> To: user@roller.apache.org
> Subject: Re: Tags
>
> On Sat, Feb 14, 2009 at 2:29 PM, Odelya YomTov <odelya@jpost.com> wrote:
>> I have a problem that I am trying to solve for quite a long time.
>> I want to display tags for all the site.
>> So I use the method:
>> $site.getPopularTags(-1, 10)
>>
>> #foreach ($tag in $mytags)
>>    <a class="tag${tag.intensity}"
href="$url.tag($tag.name)">$tag.name</a>
>>   #end
>
> OK. Good. Make sure that is the tempate that your main blog's tagsIndex
> page.
>
>
>> The URL points to my site + /tags/harris etc..
>
> Good.
>
>
>> In the site I have the following code:
>> #set($pager = $model.getWeblogEntriesPager())
>> #set($map = $pager.getEntries())
>> #if ($map.keySet().size()!=0)
>> #foreach($day in $map.keySet())
>>  #set($entries = $map.get($day))
>>  #foreach($entry in $entries)
>>    $entry.title
>>  #end
>>  #end
>> #end
>>
>> But it doesn't display the entries with the tags as I would expect!
>> $model.getWeblogEntriesPager() - retruns an empty pager.
>> (I saw an example in http://blogs.sun.com/)
>> What do I need to change in the main blog's code so it would work?
>
> Site wide pagers work a little differently. They don't divide entries
> up into a day map.
>
> Try this instead:
>
> #set($pager = $site.getWeblogEntriesPager(365, 30))
> #foreach($entry in $pager.getItems())
>   $entry.title
> #end
>
> Where 365 is the number of days back in time you wish to go (or -1 for
> no limit), and 30 is the max number of entries you want.
>
> - Dave
>
>
>
>
>
>
****************************************************************************
> ********
> This footnote confirms that this email message has been scanned by
> PineApp Mail-SeCure for the presence of malicious code, vandals & computer
> viruses.
>
****************************************************************************
> ********
>
>
>
>
>



 
 
****************************************************************************
********
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
****************************************************************************
********





Mime
View raw message