[pmwiki-users] RFC: BlogSimple2

David Spitzley dspitzle at wash.k12.mi.us
Mon Jun 12 14:50:44 CDT 2006


>>> "Jon Haupt" <jhaupt at gmail.com> 06/12/06 1:06 PM >>>
On 6/12/06, David Spitzley <dspitzle at wash.k12.mi.us> wrote:
> I'd been thinking of setting up a bliki for while, so I set this up Saturday night.  It's pretty cool, but the pagelist template it uses creates some problems since it uses an (:include:) directive to insert blog posts into the pagelist.  This interacts poorly with the use of the (:title:) directive on the blog pages themselves, as they overwrite the title of any page that includes the pagelist.  I'm going to look into building an alternate template for the pagelist that's a bit more friendly.
>
>
> David
>
It would be awesome if you or anyone else figured out how to do this
without using (:include:) or if the aforementioned title/description
problem were fixed (which apparently it will be sometime).  However,
as a workaround, if you place the correct title of the page at the
very bottom of the page including the pagelist, so (:title Home Page:)
for example, as long as it's after the pagelist the title will be
correct.
-----------------------------------------------

Ok, here's what I came up with.  This still uses (:include:), but it takes advantage of the ability to limit the include to the space between two anchors, so the pagelist only includes the meat of the page.  This has the added advantage that if (like me) you have a "Categories" line at the bottom of each page, you can keep that from showing up in the pagelist results.

PageList definition
###########
[[#davidblog]]
>>blogentry<<
(:if exists PostComments.{=$Group}-{=$Name}:)
%rfloat%[[PostComments.{=$Group}-{=$Name}#comments| Show Comments]] ({PostComments.{=$Group}-{=$Name}$PostCount})
(:if !exists PostComments.{=$Group}-{=$Name}:)
%rfloat%[[PostComments.{=$Group}-{=$Name}?action=set#commentbox| Add Comment]]
(:if:)
'''{=$BlogDate} - [[{=$FullName}|{=$Titlespaced}]] by [[~{=$LastModifiedBy}]]''' (:if auth edit:)[-(''[[Edit -> {=$FullName}?action=edit]]'')-](:if:)

(:include {=$FullName}#poststart#postend:)
----
>><<
[[#davidblogend]]


Sample Blog Page
###########
(:title First Post:)
[[#poststart]]
This is my first post, and a test of the Blog functionality.  Here's hoping it works.
[[#postend]]
----
Categories:  [[!Blog]], [[!SiteAdmin]]


Sample PageList result
###########
10 June 2006 - First Post by David

This is my first post, and a test of the Blog functionality. Here's hoping it works. 
---------------------------------------------------------------------------------------------


David





More information about the pmwiki-users mailing list