Jump to content


Photo

BundleBlog

Module

  • Please log in to reply
16 replies to this topic

#1 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 31 January 2012 - 03:11 PM

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.

#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 31 January 2012 - 03:21 PM

Awesome Nico! Thanks for sharing. Will for sure check out some time.

@somartist | modules created | support me, flattr my work flattr.com


#3 ryan

ryan

    Hero Member

  • Administrators
  • 5,811 posts
  • 3135

  • LocationAtlanta, GA

Posted 01 February 2012 - 11:11 AM

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.

#4 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 01 February 2012 - 12:27 PM

Sounds nice, but I don't know how...

#5 ryan

ryan

    Hero Member

  • Administrators
  • 5,811 posts
  • 3135

  • LocationAtlanta, GA

Posted 02 February 2012 - 08:39 AM

Here's how:
http://processwire.c...__fromsearch__1

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.

#6 alanfluff

alanfluff

    Sr. Member

  • Members
  • PipPipPipPip
  • 405 posts
  • 118

  • LocationOttawa, Canada

Posted 27 March 2012 - 05:13 PM

@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!

#7 gottberg

gottberg

    Jr. Member

  • Members
  • PipPip
  • 18 posts
  • 1

  • LocationFinland, Tammisaari

Posted 15 May 2012 - 08:37 AM

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!

#8 alanfluff

alanfluff

    Sr. Member

  • Members
  • PipPipPipPip
  • 405 posts
  • 118

  • LocationOttawa, Canada

Posted 15 May 2012 - 09:09 AM

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 ;)

#9 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 15 May 2012 - 12:03 PM

@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

#10 gottberg

gottberg

    Jr. Member

  • Members
  • PipPip
  • 18 posts
  • 1

  • LocationFinland, Tammisaari

Posted 15 May 2012 - 12:40 PM

Thanks for your reply :) but i still don“t get the part where i get the stuff i blogged on my /blog site.

#11 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 15 May 2012 - 12:43 PM

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.

#12 gottberg

gottberg

    Jr. Member

  • Members
  • PipPip
  • 18 posts
  • 1

  • LocationFinland, Tammisaari

Posted 15 May 2012 - 12:49 PM

Its hidden by default right? Because when i make it visible and i see Article on the menu it says 404 error.

#13 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 15 May 2012 - 12:51 PM

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).

#14 gottberg

gottberg

    Jr. Member

  • Members
  • PipPip
  • 18 posts
  • 1

  • LocationFinland, Tammisaari

Posted 15 May 2012 - 12:59 PM

Thanks, but what should it contain? Could you give some example of how to get it?

#15 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 15 May 2012 - 01:47 PM

mmm I guess something like this should work:

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

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


#16 gottberg

gottberg

    Jr. Member

  • Members
  • PipPip
  • 18 posts
  • 1

  • LocationFinland, Tammisaari

Posted 15 May 2012 - 02:08 PM

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

#17 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 646 posts
  • 241

  • LocationBerlin, Germany

Posted 15 May 2012 - 02:14 PM

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);)





Also tagged with one or more of these keywords: Module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users