BlogSimple2-Talk

These comments have been moved from Cookbook:BlogSimple2. Please feel free to make additional comments or questions here.


Could you include newest commentboxplus.php? Please change GroupFooter, too, so that it uses commentbox instead a form. flox September 16, 2006, at 08:39 PM

done. - JonHaupt

I just set it up on my page. I had a few issues with teh code taht I worked around (or totally hacked). In blogsimple2.php, I had to comment out the section headed "also enable use of Site.SiteHeader and Site.SiteFooter". that section was forcing an "add comments" link at the bottom of the front page, and no amount of rewriting the if statements would avoid it. My workaround was to comment it out, and add a group footer page directly to the "Blog" group, instead of using the code to add that footer automatically.

fyi - in order to avoid the Site.SiteHeader and footer being used in any given group (including Main) you just have to create a GroupHeader/Footer for that group--and the Site one will be ignored. I do this very thing in my site. I wanted it to be the SiteHeader only because I have blog posts in myriad of groups and thought it'd be easier to have only one or two exceptions that did not have the comment link, than have to replicate the code in several different groupheaders/footers. - JonHaupt

One other issue is that this blog recipe breaks the wiki categories recipe, as both of these use teh group footer. I haven't yet found a fix for this.

--Fabian 9-Oct-2006

which wiki categories recipe? You mean Cookbook:ListCategories, Cookbook:MediaCategories, or Cookbook:WPCategories? I wonder if PmWiki 2.2 will make all this easier (let's hope so).

I also find that wiki categories don't work, and by that I mean both the Cookbook.ListCategories recipe and the basic "Category" page functionality built into PmWiki. Categories work fine if I don't include blogsimple2. This is with pmwiki-2.2.0-beta16. I've noticed other oddities with pagelists, trying to use the wikigallery script; I find I need to qualify the fmt on Category.GroupFooter to Site.PageListTemplates#title, rather than using simply #title. It is almost as if iterating over the list of format pages is breaking early. Anyway, from the description of this recipe, I like it. I think I would rather see the "add comments" link only on pages in the Blog category -- is there any simple way to test this? Also would be nice to be able to have multiple Blogs... -- rlt, 2006-Nov-28.

You've got me confused still about the Categories thing. They work fine for me. What are they doing on your site that isn't working? The wikigallery thing I am unfamiliar with. You can certainly do "add comments" only in pages in a certain category, by doing (:if equal {=$Group} Blog:) I think, in the Site.BlogListTemplates template(s). Using multiple blogs is actually pretty easy with BlogSimple2. You can simply use a different category other than [[!Blog]] and then whenever you want to display just that blog, you just use (:pagelist category=whatever:) instead of category=Blog. - JonHaupt
  • What about Blog.GroupFooter? That's only displayed for the Blog group. I still wonder why I don't have those pagelist problems on my test site http://beta.1stein.org. 2006-11-29 Sts

Hi! This recipe is very good. I was wondering if there is any way for someone to truncate posts that are called with the #fmtrecentblog command. I have outlandishly long posts, and they are displayed on my main page. I just want to restrict the number of characters or words and have the user click on the title if they want to see the whole thing. It would involve inserting (:if name HomePage:)... [[Link to actual page | Click here to read more]] (:ifend:)(:if name -HomePage:)The rest of the post....(:ifend:) a certain number of words into the page. I just can't figure out how to do that part. Thanks much!
-- infinity? @ [(approve links) edit diff] March 21, 2007

this is definitely an issue that could use some work. It's not an easy thing to do at the moment. One thing you could do is to use (:pagelist whatever lines=10:) and then edit the fmt=#recentblog to add the link as you described there.
Another way of doing this would be to use a separate page for the "more" part. For example, for any post you want to truncate, you could create a Group.WhateverPage-More page with the extra stuff. Then use
    (:if equal {$FullName} {*$FullName}:)
    (:include {*$FullName}-More:)(:if:)
In fact, you could put that in the Site.SiteFooter page and then it would be an automatic thing.
Then, you could actually put this in as well:
    (:if expr (exists {*$FullName}-More && !equal {$FullName} {*$FullName}):)
    [[{*$FullName}|See full text]](:if:)
or something like that. - JonHaupt April 27, 2007, at 04:28 PM
This is also another solution I made for those who have the same problem as me. If you want to have truncated posts on the main page, put this code in your main page:
function Truncate ($str) 
{
	$pagename = ResolvePageName($pagename);
	$name = PageVar($pagename, '$Name');
	if ($name == "HomePage") {
		return substr($str, 0, 100);
	} else {
		return $str;
	}
}

Markup("truncate", "inline", "/%%%(.*?)%%%/e", "Truncate('$1')");
Replace the '100' in return substr($str, 0, 100); with however many characters you want in your small version. If you want to put a link to the page you're referencing, it'll take a bit more work - you have to put a link [[PageIWantToReference | Read more...]] within the 100 (or however many characters you said) character limit. You could also try modifying the markup to include this, but I don't know how to get the reference to a page from a search, and it'll probably be kind of complicated.
--infinity? Wednesday, May 9, 2007

The latest beta of the recipe adds a slash at the end of the URL of the permalinks when listing the last few updates. Individual pages' permalinks are OK. I guess the problem must come from BlogListsTemplates.
- RealLuis 2007-05-04

hmm, I can't replicate this. Perhaps we could see a URL? The line in the template which produces the URL is this:
  [[{=$PageUrl}("Permanent Link: {=$Titlespaced}")|{=$Titlespaced}]]
My bad. I probably changed something accidentally while tinkering with your recipe.RealLuis 2007-05-20

What would be the best way for getting an RSS feed for the blog? I am blogging pages from several groups, so group level feeds would be incomplete, and all recent changes would include things that are not supposed to be part of the blog. Is there anything straightforward or do I need somewhat to create my own page list with the blog titles?
- RealLuis 2007-05-28

This took a little thought and some help from Pm, but what you need to do is use a link like the following. Obviously, replace the url with whatever you want, and you can use any page in your wiki (such as BlogArchive/BlogArchive or whatever).
  http://whateverisyoururl.blah/pmwiki/Main/HomePage?action=rss&group=*&$:Blog=1&list=blog&order=-ctime
Thanks a lot. It works really well. RealLuis 2007-05-30

Is it possible to change the date of a post afterward ? I try to change the {$BlogDate} variable within the page but it doesn't seem to work

as far as I know, the only way to edit the creation date so far is to change ctime in the wiki page file. I hope eventually we're able to have creation time as a page attribute that you're able to edit using ?action=attr, but I don't know how to do that. JonHaupt September 09, 2007, at 03:18 PM
Thanks a lot. I'll do that manualy

Sorry, but I cannot find a step by step instruction to make this recipe working. Any help would be appreciated. --errorsys 2007-10-11

I agree, I don't know how to write my first blog post, or how to do much beyond where to put the software and how to enable it with the include_once statement. Are there instructions somewhere how to actually set up your blog pages? --maria March 15, 2009

I did find a little more info in the README file downloaded with the software, but still a little sparse. Would be great to have the readme posted, so we could see what is involved in set-up before we download. --maria March 15, 2009

I too was frustrated by this scipt. However, I got it working nicely when I realized that you cannot have blogs in the DefaultGroup (usually Main). The excluded groups should be documented in the instructions because the script becomes crazy if you use an excluded group (see the list of excluded locations for SiteHeaders and SiteFooters towards the end of the script). --JHJ April 18, 2009

Talk page for the BlogSimple2 recipe (users?).