roller-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen Gilliland <>
Subject Re: should we use a different structure for page templates?
Date Thu, 13 Jul 2006 18:37:50 GMT

Dave Johnson wrote:
> Comments below...
> On 7/11/06, Allen Gilliland <> wrote:
>> i mentioned this to Dave recently and we both thought the idea merited a
>> bit more discussion so i am bringing it up here.
>> i've been wavering back and forth for quite some time on the way our
>> weblog templates are setup, meaning how we use Weblog, _day, etc, and
>> what we have now works, but i've often felt that merging the Weblog and
>> _day templates into a single template would actually be a nicer approach.
> Yes, I'm not sure forcing blogs to have a day template is really necessary.
> Back in the old days (0.9.6), we implemented day template support in
> Java code but nowadays template authors can implement day templates
> without our help, so we don't really need to mandate them.
> Of course, we need to support 2.X templates for the foreseeable future
> -- that may limit our options here.

We would definitely continue to support the old _day template, but it 
wouldn't be required anymore.

>> i think it's a bit easier on template writers to not have to switch back
>> and forth between the 2 templates to understand how the page will be
>> rendered and that really complex showEntriesInCategory() macro which
>> handles the entry display logic for collection views, permalinks, and
>> search results is a bit over the top.
> With the new macros in 3.0, that complex logic is gone. It's all been
> cleaned-up and moved into the pager object.  Allen and I know about
> all this new stuff, but for the rest of y'all... in case you're
> wondering what's going on with the 3.0 macros and models, here are a
> couple of links.
> - the new PageModel
> - the pager interface
> - the new model and pager in action in the
> Andreas08 theme
> The 3.0 stuff is starting to stabilize now and we're going to need to
> get some feedback. I hope to update the template developers guide over
> the next week.

I agree that macro has simplified quite a bit and things look *soooo* 
much nicer now.

>> there aren't any plans to implement this right now, but it's something
>> to think about.  at some point it no longer makes sense to try and make
>> the Weblog and _day templates fit the bill for all types of weblog page
>> views, and I feel like that's the path we are headed down right now.  To
>> me it makes a little more sense to separate pages out into their own
>> templates because they are easier to work on that way.
>> to add a little bit more technical info to this so that it's clear, i am
>> basically suggesting that each weblog should have 3 required templates
>> which replace the current Weblog and _day templates ...
>> Weblog - displays entry collection views like homepage and date/category
>>   pages.
>> Permalink - pretty obvious.
>> SearchResults - page for showing search results.
>> thoughts?  opinions?  the basic goal is to simplify the template editing
>> process to make it easier for users to understand and i think this
>> approach is a little bit more flexible and still easier for users to
>> grasp than the combination of the Weblog and _day templates.
> I wonder if we need to mandate any required templates beyond just the
> one main view, i.e. the Weblog template.
> There is enough information available from the models to allow a
> template author to determine the context and display the appropriate
> data.
> And I'm not sure it's a good idea to make different data available to
> different types of pages, it could lock blogs into having only one
> permalink or search page, when they actually want to have several
> depending on the category or locale.
> For example, in 3.0 now, you just put a pager on a page and it handles
> permalink, day and month views all on one page. It should be able to
> work on any page, not just one designated as a Weblog page.

That seems like a pretty good idea to me, but I do think it's nice if we 
allow for custom templates for views that are handled by the Roller and 
not the user.

The main reason not to try and have all views work off of a single 
template is because that template now needs to have logic inside of it 
which determines what kind of view it's displaying.  i.e. the Weblog.vm 
template needs to handle things a little differently if it's an entry 
collection view vs. a permalink page vs. a search results page.

The new PageModel and Pager interface has simplified this a lot, but it 
hasn't caused the problem to go away completely.  Maybe if we play with 
it some more we'll know which route to go, but I do agree that it looks 
like we can get by using just a Weblog.vm template.

-- Allen

> - Dave

View raw message