roller-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Neth <...@onthefly.com>
Subject Listing Tagged Entries on Custom Page
Date Sat, 13 Oct 2007 08:20:30 GMT
Running 3.1 since release.  I apologize if 3.1.1 or 4.0 will trivialize 
my question; I haven't had time to look at either closely, though I do 
lurk on the dev list.

I use prototype's Ajax.Updater to drop a teaser for the latest entry in 
our blog on our home page, using a custom template that produces the 
appropriate HTML fragment.  I'm now looking at adding more links into 
the blog using similar techniques, and my current task has required a 
code change to Roller.  I spent several hours poring over source code 
and trying different approaches, but I wasn't able to come up with a 
satisfactory alternative.  I thought I'd ask if there was a better way.

My objective is to associate tags with (non-Roller) pages on our site, 
and incorporate links to recent blog entries with those tags.  For 
example, if a blog entry refers to a brand of products we sell, it will 
be tagged with the name of the brand, and I'd like to display a link to 
it on the page for that brand, which will be associated with the same 
tag.  There doesn't seem to be any way to get a list of tagged entries 
from a custom page.  For about two seconds, I considered using 
performing an XSL transformation on a tag filtered RSS feed.

In the end I either needed a $model.getWeblogEntriesPager signature that 
takes a tags list, which I could then send down as a request parameter 
(though not with the name "tags", since Roller inexplicably removes 
reserved keys from the request parameter map), or else I needed 
WeblogPageRequest to make use of the "tags" parameter, which it seems to 
me it should do anyway, with the simple diff below. 

Index: src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java
===================================================================
--- src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java      (revision 532241)
+++ src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java      (working copy)
@@ -144,6 +144,10 @@
                     }
                     
                 } else if("page".equals(this.context)) {
+                    String tagsString = request.getParameter("tags");
+                    if (tagsString != null) {
+                        this.tags = Utilities.splitStringAsTags(URLUtilities.decode(tagsString));
                 
+                    }
                     this.weblogPageName = pathElements[1];
 
                 } else if("tags".equals(this.context)) {



Mime
View raw message