Great idea Allen, and I completely agree. I've not done any work in Velocity before and had seen some of the existing macros output to include the HTML, so hadn't thought about other options. You make a valid and correct point. It is the user's data. Let them get it and get out of their way when it comes to presentation. I'll plan to implement this as you suggested. Thanks for opening my eyes! Justin
--- Allen Gilliland <[EMAIL PROTECTED]> wrote: > Actually, one of the very important changes that I > am going to begin > pushing for in Roller is that we *not* continue to > define macros which > include html like this one. > > The problem with defining a macro like this is that > you force anyone > wanting to use that macro to use *your* html, which > is not desirable > true flexibility with template hacking. Instead I > would prefer to see > things like this be handled by simply providing > access to the data and > then letting the user iterate over that data and > print out whatever html > they see fit. > > Something like ... > > <ul class="archive"> > #foreach( $month in > $weblog.getListOfArchiveMonths() ) > <li class="archiveItem">$month</li> > #end > </ul> > > This is a *much* more flexible approach than telling > people to just do > this ... > > #showListOfArchiveMonths() > > My big problem with this last approach is simple, > what if I want to > display that same list, but I don't want it using > the <ul> and <li> html > tags. What if I want to do it my own way? > > The overall premise is that we should be giving > users access to the data > they need to draw up their templates, not just > dumping mounds of html on > them. > > Anyways, keep that in mind while you think through > this feature. > > -- Allen > > > Justin Grammens wrote: > > Bill, > > I got the roller-src from the latest release and > have > > it imported into Eclipse and running. Just have a > few > > configuration loose ends to tie up. > > It looks like it's going to be pretty easy to do > it. > > The question I have now is how the functionality > > should work. > > Easiest way is to do it like I have seen on > blogger > > where the velocity function will just return a: > > > > <ul class="archive"> > > <li class="archiveItem">MONTH YEAR</li> > > <li class="archiveItem">MONTH YEAR</li> > > etc.. > > </ul> > > > > based on the numer of months you pass in to the > > function - note: this is irregardless of if you > have > > posts for the month (one would assume you post > atleast > > one a month). This makes the java code very > simple, > > since it doesn't need to any DB calls. Just a > simple, > > date format and return a java List of dates going > back > > the number of months you specify. > > > > How might we (or should we) handle if the person > > want's ALL of their postings from their archive? > I'm > > thinking if a person passes in say -1, they will > get > > all of the archive postings. That might be nice, > but > > then ofcouse would require a DB call to see where > > their first posts is, and then show all of the > months > > from that point up until the current month. > Probably > > won't be too bad, do you think this -1 feature is > > nice? I'm also thinking it might also be nice to > allow > > then to format the dates, so for example they > could > > have it return, Mar 2006 or March 2006. Not sure > the > > best way to do that option. > > > > Anyway, I'll plan first work on the simpler (no > db) > > call option first and think about the others > later. > > Thanks, > > Justin > > > > > > --- Tribley William-cwt010 > <[EMAIL PROTECTED]> > > wrote: > > > >> Justin, > >> That would be wonderful. I am helping a friend > get > >> into blogging by > >> setting Roller up, he wants this feature, I was > >> trying to figure out how > >> I could hack out the time to learn the Velocity > >> template system enough > >> to get this working. > >> > >> If you want a tester we can help. > >> > >> Thanks, > >> Bill > >> > >>> -----Original Message----- > >>> From: Justin Grammens > >> [mailto:[EMAIL PROTECTED] > >>> Sent: Monday, March 27, 2006 6:10 PM > >>> To: [email protected] > >>> Subject: Re: Links to previous months? > >>> > >>> Great! Looks like I've just found myself a > project > >> to work > >>> on. If no one minds, I'll do some reading on the > >> developer > >>> site for creating macros and take a stab at it. > If > >> people > >>> think it's useful I'll be more than happy to > >> contribute it back. > >>> Thanks, > >>> Justin > >>> > >>> --- David M Johnson <[EMAIL PROTECTED]> > >> wrote: > >>>> No, we don't currently have a macro for that, > >> but it's definitely a > >>>> good idea. > >>>> > >>>> - Dave > >>>> > >>>> > >>>> > >>>> On Mar 26, 2006, at 6:42 PM, Justin Grammens > >> wrote: > >>>>> Does Roller have the ability to show links for > >> say > >>>> the > >>>>> last X number of months in the sidebar of my > >>>> template? > >>>>> I have looked through the API macro > >> documentation > >>>> at: > >>>>> http://rollerweblogger.org/velocidoc/ > >>>>> and can't seem to find what I'm looking for. > >>>>> I guess I could easily add a link for each > >> month > >>>> and > >>>>> manage it myself, but I was hoping maybe there > >> was macro > >>> that would > >>>>> do it automatically. I have seen > >>>> may > >>>>> other blogs out there do this. I just want it > >> to > >>>> show > >>>>> say the last 9 months (February 2006, January > >>>> 2006, > >>>>> December 2005, etc..) and a user could hop > >> back without having to > >>>>> click on the calendar link, 9 > >>>> times > >>>>> to manually go back. > >>>>> Thanks for any help if people have done this > >>>> before. > >>>>> I'm guessing I have just missed how to do it > >> in > >>>> the > >>>>> FAQ. > >>>>> Justin > >>>>> > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
