Jump to content

Recommended Posts

Posted

Hello,

this module is a little compilation of things you need to use ProcessWire to write a blog. It'll create:

Templates

  • blog_admin
  • blog_article
  • blog_category

Fields

  • tags (using the "TextboxList" fieldtype)
  • category (using the "Page" fieldtype)

Pages (hidden, using the "blog_admin" template)

  • article (you should create a subpage using the "blog_article" template for each article)
  • page (same like article or you could create a "blog_page" template if you want)
  • category (you should create a page using the "blog_category" for each category and if you want you can also create subcategories)

It requires the "FieldtypeTextboxList" module (I placed it in the "BundleBlog" folder, too).

For comments you can use the built-in "ProcessComments" module.

If you have any wishes please let me know.

Download

P.S.:

I'll also add my preview module in a further version.

  • Like 2
Posted

Nico this looks really nice. Quality code too. I also look forward to checking this one out in more detail. It did get me thinking that you might also be interested in distributing something like this as a site profile. The advantage there is that you can have everything already setup so that someone can install and literally start creating blog entries with everything ready-to-go. Let me know if you are interested in doing this as a site profile too, and I'll be happy to collaborate with you on it.

Posted

Here's how:

So you basically create the blog site, then run that profile export. Then take the /site-default/ directory from a blank ProcessWire (one where the installer hasn't yet been run) and replace these directories in it with the ones from your blog site:

/site/templates/

/site/modules/

/site/install/

Then zip up that entire /site-default/ directory, or put it on GitHub. This is a site profile. Now anyone can replace the /site-default/ directory in a new copy of ProcessWire with yours, and it'll install your blog site.

I also often use this technique for migrating client sites from dev to live.

  • Like 1
  • 1 month later...
Posted

@Nico THANKS for this module, about to try it :) One suggestion in case it's helpful, I already had a field called tags and I just wondered if it would be good to namespace your Fields as you did your Templates? Thanks again for the Module!

  • 1 month later...
Posted

Hi, i feel stupid but i dont get it how to use this. I have installed the module and now im stuck. Could some one explain a little deeper :).

Thank you!

Posted

Hi gottberg, I'm sorry I won't be much help. In the end I went about making a blog from scratch rather than using this module, I'm part-way through that but had to pause while I worked on some other stuff. Sorry this is not helping you and I've not documented what I did. I hope to do that once I've got it all working in case it helps others. Good luck and you will not need it I don't think, I solved all my "how do I"'s by searching/asking on this forum where lots of people are a lot more knowledgeable than me ;)

Posted

@gottberg: Now you should have some pages in your page tree called "article", "page" and "category". You can post your posts as subpages of "article" (using the "blog_article" template) or static pages as subpages of "page" (using the "blog_page" template). And if you want some categories for your articles you should first create some categories as childs of "category" and later the select the wanted while you're creating the article. Tags for you're article are avaiable, too (you'll see it if you create a new page using the "blog_article" template).

/ Nico

Posted

I guess it should be available at /article. But you can change the name to blog so you can get your posts if you're typing /blog.

Posted

Yes it is. You'd have to create a "blog_admin.php" in your templates folder or display the articles on a special page (e.g. /blog, but then articles would have a path like /article/abc).

Posted

mmm I guess something like this should work:

$articles = $pages->find('template=blog_article');

foreach($articles as $article) {
echo $article->title;
}
Posted

Thank you! That solved everything! :) i have one last questetion, how could i get the time posted? The time when the post was created.

Simon

Posted

Mmm should be: $article->created; (it'll give you the timestamp, so you have to use it like this: date('Y-m-d', $article->created);)

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...