You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Daniel Ruan <da...@gmail.com> on 2011/04/08 07:03:00 UTC

tagsIndex Template (Roller 4)

Hi,

I am trying to set up a tagsIndex page with the following in theme.xml:

    <template action="weblog">
        <name>weblog</name>
        <description>weblog</description>
    <link></link>
        <navbar>false</navbar>
        <hidden>true</hidden>
        <templateLanguage>velocity</templateLanguage>
        <contentType>text/html</contentType>
        <contentsFile>weblog.vm</contentsFile>
    </template>

    <template action="tagsIndex">
        <name>tagsIndex</name>
        <description>tagsIndex</description>
        <link></link>
        <navbar>false</navbar>
        <hidden>true</hidden>
        <templateLanguage>velocity</templateLanguage>
        <contentType>text/html</contentType>
        <contentsFile>tagsIndex.vm</contentsFile>
    </template>

However, Roller doesn't pick up the tagsIndex template.  Any ideas?

Thanks,

Daniel

Re: tagsIndex Template (Roller 4)

Posted by Dave <sn...@gmail.com>.
On Fri, Apr 15, 2011 at 3:02 PM, Daniel Ruan <da...@gmail.com> wrote:
> Hi Dave,
>
> I thought the tagsIndex template is used to display entries by a given tag (
> http://rollerweblogger.org/roller/entry/roller_themes_part_2).  But the line
> in PageServlet reads:
>
>    } else if ("tags".equals(pageRequest.getContext()) &&
> pageRequest.getTags() == null) {

Yep, that's a bug in Roller 4, the current code base has this:
   } else if ("tags".equals(pageRequest.getContext()) &&
pageRequest.getTags() != null) {

It was quietly fixed in rev 755000 (http://s.apache.org/wA)

- Dave

Re: tagsIndex Template (Roller 4)

Posted by Daniel Ruan <da...@gmail.com>.
Hi Dave,

I thought the tagsIndex template is used to display entries by a given tag (
http://rollerweblogger.org/roller/entry/roller_themes_part_2).  But the line
in PageServlet reads:

    } else if ("tags".equals(pageRequest.getContext()) &&
pageRequest.getTags() == null) {

So it looks like it loads the tagsIndex page only when you don't provide any
specific tags.  This is confirmed by my URL experiment:

1)

http://localhost/home/tags/spring
-> displaying the weblog template, entries tagged by "spring"

2)

http://localhost/home/tags/
-> displaying the tagsIndex template, all entries (the ending / is required;
otherwise 404)

3)

http://localhost/roller-ui/rendering/page/home/tags/spring
<http://localhost/roller-ui/rendering/page/home/tags/spring>-> using the
weblog template, entries tagged by "spring", same as (1)

4)

http://localhost/roller-ui/rendering/page/home/tags
-> displaying the tagsIndex template, all entries. same as (2)

I read another thread discussing tagsIndex in Roller 5, where he got
"/tags/xxx" to display all entries by "xxx" using the tagsIndex template.
 So maybe this is a bug in Roller 4?

Thanks,
Daniel

On Tue, Apr 12, 2011 at 8:31 PM, Dave <sn...@gmail.com> wrote:

> Take a look at the doGet() method of the PageServlet for the
> template-choosing logic.
>
> - Dave
>
>
>
> On Sun, Apr 10, 2011 at 4:17 PM, Daniel Ruan <da...@gmail.com> wrote:
> > I turned on the debug but didn't see any error messages.
> >
> > We had our own theme. The templates we created for permalink and wegblog
> > etc. worked fine.
> >
> > As a test, I changed the name of the tagsIndex template to a non-existing
> > file name and got an exception "Couldn't load  template
> > file"  from ThemeManagerImpl.  This means the XML config is not a problem
> as
> > it did cause Roller to load the file.
> >
> > What is the class that chooses the template file at run time based on the
> > URL?
> >
> > Thanks,
> > Daniel
> >
> > I don't see any problem with your tagsIndex part of of theme.xml. Are
> >> you working with a build-in Roller theme or something new? See
> >> anything in the logs?
> >>
> >> If you turn on DEBUG logging for the rendering system you might find
> >> some clues about what is going wrong. Add this to your
> >> roller-custom.properties to turn on DEBUG for rendering:
> >>
> >>    log4j.logger.org.apache.roller.weblogger.ui.rendering=DEBUG
> >>
> >> - Dave
> >>
> >
>

Re: tagsIndex Template (Roller 4)

Posted by Dave <sn...@gmail.com>.
Take a look at the doGet() method of the PageServlet for the
template-choosing logic.

- Dave



On Sun, Apr 10, 2011 at 4:17 PM, Daniel Ruan <da...@gmail.com> wrote:
> I turned on the debug but didn't see any error messages.
>
> We had our own theme. The templates we created for permalink and wegblog
> etc. worked fine.
>
> As a test, I changed the name of the tagsIndex template to a non-existing
> file name and got an exception "Couldn't load  template
> file"  from ThemeManagerImpl.  This means the XML config is not a problem as
> it did cause Roller to load the file.
>
> What is the class that chooses the template file at run time based on the
> URL?
>
> Thanks,
> Daniel
>
> I don't see any problem with your tagsIndex part of of theme.xml. Are
>> you working with a build-in Roller theme or something new? See
>> anything in the logs?
>>
>> If you turn on DEBUG logging for the rendering system you might find
>> some clues about what is going wrong. Add this to your
>> roller-custom.properties to turn on DEBUG for rendering:
>>
>>    log4j.logger.org.apache.roller.weblogger.ui.rendering=DEBUG
>>
>> - Dave
>>
>

Re: tagsIndex Template (Roller 4)

Posted by Daniel Ruan <da...@gmail.com>.
I turned on the debug but didn't see any error messages.

We had our own theme. The templates we created for permalink and wegblog
etc. worked fine.

As a test, I changed the name of the tagsIndex template to a non-existing
file name and got an exception "Couldn't load  template
file"  from ThemeManagerImpl.  This means the XML config is not a problem as
it did cause Roller to load the file.

What is the class that chooses the template file at run time based on the
URL?

Thanks,
Daniel

I don't see any problem with your tagsIndex part of of theme.xml. Are
> you working with a build-in Roller theme or something new? See
> anything in the logs?
>
> If you turn on DEBUG logging for the rendering system you might find
> some clues about what is going wrong. Add this to your
> roller-custom.properties to turn on DEBUG for rendering:
>
>    log4j.logger.org.apache.roller.weblogger.ui.rendering=DEBUG
>
> - Dave
>

Re: tagsIndex Template (Roller 4)

Posted by Dave <sn...@gmail.com>.
On Fri, Apr 8, 2011 at 1:03 AM, Daniel Ruan <da...@gmail.com> wrote:
> I am trying to set up a tagsIndex page with the following in theme.xml:
>
>    <template action="weblog">
>        <name>weblog</name>
>        <description>weblog</description>
>    <link></link>
>        <navbar>false</navbar>
>        <hidden>true</hidden>
>        <templateLanguage>velocity</templateLanguage>
>        <contentType>text/html</contentType>
>        <contentsFile>weblog.vm</contentsFile>
>    </template>
>
>    <template action="tagsIndex">
>        <name>tagsIndex</name>
>        <description>tagsIndex</description>
>        <link></link>
>        <navbar>false</navbar>
>        <hidden>true</hidden>
>        <templateLanguage>velocity</templateLanguage>
>        <contentType>text/html</contentType>
>        <contentsFile>tagsIndex.vm</contentsFile>
>    </template>
>
> However, Roller doesn't pick up the tagsIndex template.  Any ideas?

I don't see any problem with your tagsIndex part of of theme.xml. Are
you working with a build-in Roller theme or something new? See
anything in the logs?

If you turn on DEBUG logging for the rendering system you might find
some clues about what is going wrong. Add this to your
roller-custom.properties to turn on DEBUG for rendering:

    log4j.logger.org.apache.roller.weblogger.ui.rendering=DEBUG

- Dave