Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

BalusBlog-Talk

Discussion of BalusBlog

Please provide a name and a date (use ~~~~) in each post and divide all threads using a horizontal rule like in this example:


Balu August 12, 2007, at 05:14 PM

So what exactly is this for?

Balu August 12, 2007, at 05:14 PM

Hey, you should know after all!

PKHG August 16, 2007, at 01:26 AM

I just learned the meaning of 4 times ~ ;-)
Trying to understand (I have disregarded pagelists until now) I would like to see an example for a newbie
You are speaking in the recipe description to one who already knows PmWiki (nearly) by heart.
Never the less some local success: I have now a BlogEntries.HomePage, showing two published Entries (hurray), though I understand all this (now) half.

Balu August 17, 2007, at 02:31 PM

I'm sorry and hope you didn't put too much work in it yet, but after fiddling around for a few days with the two different groups I thought that it should be possible to overcome this splitting. So I've modified the recipe to have everything in one group. I also removed all unneeded ballast from the page list templates, to hopefully make it easier to understand for newbies. You still need to try to learn PageLists though if you want to use it's full potential.

PKHG August 20, 2007, at 08:37 AM

Thanks and yes I know ... will be done ... ;-)

Balu August 25, 2007, at 07:10 PM

I'm playing with the RSS feed possibilities right now, perhaps someone can have a look at the following and let me know if I can/should optimize anything in this code snippet (from config.php).
// support feeds
if ($action=='rss') {
    include_once('scripts/feeds.php');

    $_group = PageVar($pagename, '$Group');
    if ($_group=='Blog') {

        // set defaults for the blog group
        $_REQUEST = array(
           'group' => $_group,
           'name'  => '????-??-??[-_]*',
           'order' => '-name',
           'count' => 10
        );

        // global RSS options
        $FeedFmt['rss']['feed']['title'] = '$WikiTitle Blog';
        $FeedFmt['rss']['feed']['description'] = 'Balus Blog';
        // why is ?action=rss added by default to the link tag?
        $FeedFmt['rss']['feed']['link'] = '{$PageUrl}';


        // Google Reader does not like text/xml :-(
        // proper value should be application/rss+xml anyhow
        $FeedFmt['rss']['feed']['_header'] = 'Content-type: application/rss+xml; charset="$Charset"';


        // helper function that fetches the title pagetext variable for each item
        // (or the default from page BlogOverviewTemplate)
        function BlogTitle($pagename)
        {
            $PTVTitle = PageTextVar($pagename, 'Title');
            if ($PTVTitle=='') $PTVTitle = PageTextVar($_group.'/BlogOverviewTemplate', 'TitleDefault');
            $PTVTitle = strip_tags(MarkupToHTML($pagename, $PTVTitle));
            return $PTVTitle;
        }
        $FmtPV['$BlogTitle']   = 'BlogTitle($pn)';
        $FmtPV['$BlogExcerpt'] = 'htmlspecialchars(MarkupToHTML($pn, "(:include $pn#entrybody#extendedbody:)"))';

        // content of RSS items (besides default)
        $FeedFmt['rss']['item']['title']       = '$BlogTitle';
        $FeedFmt['rss']['item']['description'] = '$BlogExcerpt';

        // W3C feed validator says: an item should not include both pubDate and dc:date
        // W3C feed validator says: item should contain a guid element
        $FeedFmt['rss']['item']['dc:date']     = '';
        $FeedFmt['rss']['item']['guid']        = '<guid isPermaLink="true">{$PageUrl}</guid>'."\n";
    }
}

?SH August 27, 2007, at 11:16 AM> Why not 'hyperlink' the title in the BlogOverviewTemplate page ?

(:if equal "{=$:Title}" "":){$:TitleDefault}(:else:)[[{=$FullName}|{=$:Title}]](:ifend:)
Balu September 20, 2007, at 11
02 AM: Nice idea, you can of course do that if you like to ;).

pjv October 3, 2007, at 19:20 GMT

I've just added a note to the HaloScan comment recipe on how to get HaloScan commenting working with Balu's blog system. Works like a charm now!

Rommel November 23, 2007, at 06:35 AM

I'm not sure if anyone experience the same but if I create a wiki page called 2007-11-23-Something the page name becomes Friday, 23 November 2007-Something. Is there a way to turn-off this behavior? I tried changing my pattern to 2007_11_23_Something but it to turned into 20071123Something.

DaveG December 22, 2008, at 22:26

To further simplify things, I'd suggest removing the GroupHeader, and add the include from the group header as the first line in the blog entry ((:include BlogDetailTemplate:)). Then move the if condition from the GroupHeader ((:if name ????-??-??[-_]*:)) into the BlogDetailTemplate.
I'd also suggest removing the page naming convention, and use either variables or Categories to do matching. For Archiving, I'd add a 'Date' variable to the BlogDetailTemplate, and run pagelists from that. I suspect that more closely matches the way people prefer to name blog pages, for SEO, and readability.

Balu December 23, 2008, at 02:44 AM

I'm a little short on time to test your first modifications, but the idea behind the date in the page name is that PmWiki does not have to open all files in the Blog category to figure out it's timestamp. If you have the date in the page name it can create the corresponding pagelist a lot faster.

DaveG December 23, 2008, at 21:31

Understood, and I agree that in principle it's best not to open the files. However, using page variables opens up a whole new vista of possibilities. I'd be interested in knowing the actual performance (speed) and CPU hit on a wiki with 100, and 1000 pages -- on the large assumption that not many 'user' blog are *usually* going to go beyond that.

Edit - History - Print - Recent Changes - Search
Page last modified on December 23, 2008, at 08:34 PM