Jump to content

Recommended Posts

@kongondo. Thank you for this very useful module. It will find a home in a couple of installs I have in the queue right now. I owe you one!

  • Like 1

Share this post


Link to post
Share on other sites

Update: Blog version 1.2

Read below before updating.

For new installs, proceed as normal

-------------------------------------

Changelog

TL:DR: Comments visibility settings + Posts' Bulk Actions + Update Script

Comments

Comments visibility can be controlled 'globally' as well as on a 'per post' basis

Default is that comments and comment form are visible. You do not need to specify this setting; it just applies

A post's comments SPECIFIED visibility overrides the global setting except for one case (see below).

Post Comments Settings are set via a page select on a Post's page (also in 'Settings' tab in Blog Dashboard - see below)

  • No selection: Default [comments and comments form will be shown]
  • Always Show Comments: This will enforce overriding of global setting (e.g. Disable Comments) 
  • Disable New Comments: Will show old comments but not the comments form; visitors will not be able to submit new comments & message 'Comments closed for this post' will be shown.
  • Disable Comments: Will neither show old comments nor the comments form; visitors will not be able to submit new comments & will see message 'Comments not allowed for this post'. Old comments WILL NOT be deleted :D.

Global Comments Settings are set via a page select on the Comments page (in Dashboard as well). Settings here DO NOT override a Post's Comments settings WHERE A SELECTION has been made (i.e. if NOT empty).

  • No selection: Default [comments and comments form will be shown]
  • Disable New Comments: Similar to above Post setting except will affect all Posts' comments where no comments visibility selection has been made. 
  • Disable Comments: Similar to above Post setting except will affect all Posts' comments where no comments visibility selection has been made. 

Global Maximum comments allowed per post.

If any number > 0 is specified in this new setting, IRRESPECTIVE of a Post's comments settings, if a post's comments is greater than the maximum set here, then 'Disable New Comments' will kick in. So, this takes precedence.

Note: If you are logged in as superuser, even PENDING and SPAM comments are counted; so, the Global Maximum may be 'temporarily reached', if that makes sense :-)

Recap of comments visibility, in order of descending priority:

1. Global Maximum comments allowed for posts (/blog/comments/)

2. Any comment visibility SPECIFIED on a post (i.e. not empty) (/blog/posts/your-post/)

3. Any Global comment visibility SPECIFIED on comments page (/blog/comments/)

4. Default.

'Settings' Tab

You can also set both the Global comments visibility and the Global Maximum comments allowed per post on this tab. The current setting will always be selected in the input field.

Note: A blank Global comments visibility means no setting specified :-). So, if you want to change to 'no global setting specified', just select a blank and save [equivalent to deselecting a page select] (hope this makes sense).

Note: Where no Global Maximum comments is set (i.e. blank), saving in the 'Settings' Tab's General Settings will subsequently show a '0' [zero]. This is equivalent to a blank, so not to worry :D

Bulk Actions

Introducing Bulk Actions for the Posts Tab! Make bulk changes to posts:

  • Unpublish/Publish
  • Comments visibility (as specified above for Posts' Comments visibility). In this case, also a 'Default Comments View' selection available. This is the equivalent of the 'no selection' specified in page selection field above.
  • Trash
  • Delete (note: no warning given before delete; careful with this one!)

New column in Posts' Table also shows currently specified Comments visibility for each post. 'Default' means no selection made.

Other

- Some code clean-up.

- See blog-side-bar.inc issue below.

UPDATING

I have written an update script (attached) that will add the new features in Blog 1.2 (2 fields, 1 template, 3 pages, 2 page updates, etc.).

I have thoroughly tested the script. However, try this first on a test/non-essential install! If everything works, you can use it on your live environment

Note: This assumes you haven't changed the native Blog paths and page names. Otherwise, it won't work properly. It won't corrupt any data but may just not install some stuff :D

Note: You will still need to update the module as normal in your PW admin! Above is just to save you manually creating the extra fields, etc.

To update:

# Copy and paste the contents of blog-upgrade-version1-2.txt at the very top of one of your template files. Save the template file.

# The script will only run if you are logged in as a superuser so other users won't know what's happening.

# View a page using the template file you've just amended. The new fields, template and pages will be created.

# Reverse the changes to your template file and save.

# Update Blog via PW Admin as usual (to version 1.2)

# Copy blog.css to /site/templates/css/

blog-upgrade-version1-2.txt

If you are using the blog-side-bar.inc you might want to make/note the following changes. This only affects existing Blog installs! (not new ones)

There was a missing <br> tag + $item->date instead of $item->blog_date. This will ensure Recent Comments widget also show the Post's date. If you are using the code from this file, you can make the following changes:

OLD:

$date = $blogOut->formatDate($item->date);
$out .= "<li><span class='date'>$date</span> <a href='{$item->url}'>{$item->title}</a></li>";

NEW:

$date = $blogOut->formatDate($item->blog_date);
$out .= "<li><span class='date'>" . $date. "</span><br> <a href='{$item->url}'>{$item->title}</a></li>";

In addition, the code has now been changed not to show 'recent posts widget' on the blog home page. @Adrian idea, thanks!

Screens

post-894-0-20033400-1401805227_thumb.pngpost-894-0-50240100-1401805228_thumb.pngpost-894-0-25658900-1401805233_thumb.pngpost-894-0-51929000-1401805234_thumb.pngpost-894-0-17408000-1401805231_thumb.pngpost-894-0-63958900-1401805229_thumb.png

Happy blogging! O0  :lol:

  • Like 7

Share this post


Link to post
Share on other sites

ASAP i will provide german language files...;) Great Work!

  • Like 4

Share this post


Link to post
Share on other sites

ASAP i will provide german language files... ;) Great Work!

Thanks! I think there are a few remaining strings that need to be made translatable as well like the 'No' and 'Yes' for published posts. I'll get to them later. 

Share this post


Link to post
Share on other sites

Kongondo. I am in awe!  WOW, WOW, WOW!!!  My mouth has dropped to the floor and my prayers have been answered! This has been designed so beautifully, logically, and intuitively  :'(You are super talented my friend. This is something that has been needed for quite some time. Thank you so much for this!!!

I'm speechless.

  • Like 4

Share this post


Link to post
Share on other sites

Great Module!

sorry, if it was answered before, i couldn't find any mention on this topic:

Does this module work in multilingual environments (german + english)?

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

....Does this module work in multilingual environments (german + english)?

Thanks!

I have never worked in a multilingual ProcessWire environment so I hope my answer doesn't seem foolish :D

Output strings are all translatable. See posts above; someone has worked on/produced German translations. There's maybe 1 or two texts not yet made translatable but will do a final check soon...

Glad you like the module :-)

Share this post


Link to post
Share on other sites

i'l translate the actual version - but last days was very bussy...

only problem that i'll see for now is the handling of dates and the calendar overview....this should changed to a multilingual version....i thought i've read a snippet for this from Apesia that support something simiar for displayed calendars, too....

  • Like 1

Share this post


Link to post
Share on other sites

here we go  == German language for ProccessBlog

i'll need this great Addon in some weeks for a own blog, so i will contribute some more lost strings that are not translatable until now....so stay tuned.

Thanks to Kongondo! This is really great Addon - i'll love ProcessWire at the first glance it is perfect to setup websites and get learning PHP faster!

  • Like 4

Share this post


Link to post
Share on other sites

I have built a few websites on Processwire now but for some reason cannot rap my head around implementing this blog into my current design. I don't understand why you have so many template files and how to edit or get things to output in my html/css coded pages. I would like to just be able to plug the right calls into my current design. Please advise. Complete stuck trying to implement this into my current design.

Share this post


Link to post
Share on other sites

Franko,

Sorry to hear you are having problems implementing Blog. Apologies, I have not had time to write the documentation. It is however quite easy to fit Blog in any design. The reason for the 'many' template files is explained in several posts in this thread :-). In a nutshell, the many template files have nothing to do with the module; they are only examples, are necessarily verbose and are meant to showcase the methods/functions available within MarkupBlog. Blog is a module and you can call it anywhere, any time you want in your template files. I will write up what its methods do and how to use them when I get some time. 

  • Like 1

Share this post


Link to post
Share on other sites

Ok, so maybe you can point me in the right direction. How do I output my code? I edited the template files with my html and added the php calls you had in your template files. That seems to work, but there is a bunch of code outputting that is not mine and messing things up. I'm assuming that I need to edit the MarkupBlog.module file? The only thing is I can't figure out what needs to be changed in that file to output my html. I'm also assuming that I change the things where there is code listed after all the $out .=   but there seems to be a lot of code that that I do not need. Please advise. 

Share this post


Link to post
Share on other sites

No. Do not edit MarkupBlog.module. On update, your changes will just be overwritten. In addition, remember, this is a Markup Module; such modules output some markup. The markup has IDs and classes that you can target with your CSS and do whatever you wish.

What do you mean by messing things up? What template file are you referring to? Even blog.css is just a demo file. If you are using that, you can delete it or use it as a baseline for your blog. Same goes for pocketgrid.css. 

Using the example template file blog-post.php (for single posts), to get you up and running quickly, only use the PHP up to line 48. Delete the rest of the HTML below. However, to output the main content of the post, you will need to echo somewhere $content. In that example template file, I have called that variable $content; it could be anything you want. Still on this example, I include the right sidebar stuff using blog-side-bar.inc. You may choose to do it differently. Have a look at the code in there to see how simple it is. My guess is that you are new to PHP? Anyway, try that first and let me know. Are you developing locally or there is a test site I could look at?

Share this post


Link to post
Share on other sites

Yes I am new to php. Ok so I am now assuming that I need to write the php in the top section of the page and echo the content with the tag on the page. I then need to write the css based on the output of your code that comes out when it is echo on the page. Correct?

Here is my code which is different from what outputs. Some elements like the <article> are repeating.

<section id="content" class="cols-a">
<div class="news-a">
<article>
<header>
<p>Thursday, April 3, 2014</p>
<h2><a href="./">Safety Tips for the Garage</a></h2>
</header>
<figure><img src="http://placehold.it/660x160" alt="Placeholder" width="660" height="160"></figure>
<p>You have taken special care to be sure that your home is safe. If you have small children, you’ve childproofed the electrical outlets. If you have older children, you’ve discussed Internet safety and might have installed a filter to block objectionable material. You likely have used baby gates, screened babysitters, and are careful when you use a ladder. Undoubtedly, safety is important. Many times, however, safety issues in the garage are unintentionally overlooked, because the area is not seen as an actual room that your family lives in. Here is a list of things to double check to be sure that your garage is as safe as possible...</p>
<p class="link-b"><a href="./">Read more</a></p>
</article>
</div>
</section>
 
The article section needs to repeat for each post like in the image. screenshot.png
 
 
This is whats outputting
 
screenshot2.png
 
 
 
 
This is the code I am using in the page.
 
    //main content
    $limit = $page->blog_quantity;//number of posts to show on Blog Home Page (pagination kicks in if more posts than limit)
    $content = '';
    $content .=  $blogOut->renderPosts("limit={$limit}");
 
So I am not sure how to get it to output that I want. My lack of php skills is most likely the problem but I have come to love Processwire over Wordpress and Modx. Any help would be appreciated. 
 

Share this post


Link to post
Share on other sites

- For "Read more" funktionality you should take a look at the settings in the "posts" Page for truncate...

- like i see in the example files there is no imageoutput maybe her could konkondo give a best practise example that fits the example templates that ships with the MarkupBlog

- the templates for the main output is

  • the blog-post - how look a single post
  • and the blog-posts - overview of all posts
  • and the blog template with a little different overview

there is always a php setting for the content and some vars and below there is the HTML Markup Output.

Or you could write your own template for overview and single-post view and grab the content like shown in example template files direct in your HTML via the PW API.

kind regards mr-fan

Share this post


Link to post
Share on other sites

This module looks awesome - thanks hugely for sharing :)

Could I ask (pretty new to Processwire so apologies if this is easy or not possible or anything like that). Would it be possible to modify the post URI so that instead of something like /blog/posts/this-is-a-post you could have something like /blog/2014/06/this-is-a-post

So essentially it'd categorize the posts into year and month. This is similar to how Wordpress and a couple of other CMS/Blog systems do it as default, and it's pretty handy as if you've got 2 posts with the same name, they are less likely to clash if you're also including/checking the month/year.

Also, I read through the thread and saw a mention of having a publish date/time - has this been implemented? If not I'm probably going to be doing some work on a few of my own modules in the next week or two, so would be happy to see about doing a pull request with it as it's something I'll need to add anyway :)

  • Like 1

Share this post


Link to post
Share on other sites

Also, I read through the thread and saw a mention of having a publish date/time - has this been implemented? If not I'm probably going to be doing some work on a few of my own modules in the next week or two, so would be happy to see about doing a pull request with it as it's something I'll need to add anyway :)

Scheduled publishing is an integral part of the workflow for many bloggers, so this would definitely make sense. I couldn't live without such a feature anymore.. :)

@kongondo: if you're still pondering whether to use SchedulePages somehow or cook up your own method, I'd vote for SchedulePages. Admittedly I'm being somewhat selfish here (I'm sure we'll be using this module for our client sites and I don't like the idea of having to explain why and how scheduling posts is different from all other pages) but it's also a great module :)

  • Like 2

Share this post


Link to post
Share on other sites

Seriously? If yes, out of the box, no. But with some trickery, you can have MarkupBlog output posts from only a particular author, assuming each author has their own blog. I am just thinking out loud here. If this is a feature request, I'd like to have more details but also hear what others think :-)

Glad you like the module. :D

Sorry for spamming (sort of), but just wanted to comment on this one that most (quite possibly all) of the sites we've implemented a blog for have more than one blog. Doesn't sound that far fetched to me: one or more for internal use, one for each division (a lot of our blogging clients are municipalities and they've got a ton of these), one for CEO/mayor, one for each temporary project etc.

Also, if you were referring to creating a bunch of user-specific blogs: I've explained this sort of behaviour (in another system) to clients over and over and over and can assure you that, though it may sound like the logical solution, in real world it just doesn't work.. unless you also allow some sort of "blog superusers" to post with any user account, which could introduce an entire set of new problems :)

One typical situation is a CEO or mayor having his/her own blog. Most people of that caliber simply don't have much spare time and blogging is rarely considered a core task, so even if this person does really write his/her own posts, there's a very high probability that someone else handles posting them online.. which is where the trouble starts if each blog is tied to one user. I'm sure you get the point.

Anyway, I'd appreciate if you could consider this kind of feature, but I get that it's probably not too high in priority :)

  • Like 1

Share this post


Link to post
Share on other sites
One typical situation is a CEO or mayor having his/her own blog. Most people of that caliber simply don't have much spare time and blogging is rarely considered a core task, so even if this person does really write his/her own posts, there's a very high probability that someone else handles posting them online.. which is where the trouble starts if each blog is tied to one user. I'm sure you get the point.

One nice thing that Wordpress has is the ability to change the author of a post from the person who is creating it and logged in. Maybe an author PageField that allows you to select from other PW users that have a blog author role, or something along those lines?

  • Like 1

Share this post


Link to post
Share on other sites

One nice thing that Wordpress has is the ability to change the author of a post from the person who is creating it and logged in. Maybe an author PageField that allows you to select from other PW users that have a blog author role, or something along those lines?

Adrian, you can already change the author of the post..unless am not getting you? Check the settings tab when editing a blog post page

  • Like 1

Share this post


Link to post
Share on other sites

One nice thing that Wordpress has is the ability to change the author of a post from the person who is creating it and logged in. Maybe an author PageField that allows you to select from other PW users that have a blog author role, or something along those lines?

Agreed. This might be a valid solution for the user-specificity part, though "regular" bloggers probably shouldn't have the permission to do this -- right?

Whether this solves the question of having multiple separate blogs still doesn't seem entirely obvious to me. In another system we've used it was possible to create and embed separate blogs, with their own names and other settings, to different parts of the site. That was pretty handy, actually. Each blog being tied to one user account (in a way that made it impossible to change later) was the problematic part.

If only we could somehow had both.. :)

Edit: I'll have to take a closer look at post settings based on @kongondos reply above, but just wanted to clarify the part about "regular bloggers' permissions". In our case bloggers are sometimes actually users that have absolutely no other permissions -- can't edit content etc. Them being able to edit other bloggers' posts or change authors of those would be far from optimal. Could be specific to our case, though..

Edited by teppo

Share this post


Link to post
Share on other sites

Guys,

Sorry I have been rather quiet in the recent past. You may have noticed I am in holiday mode and have been following, rather keenly, the trajectory of a certain spherical leather object :P  :lol: ....Two more weeks to go and I should be back in play....(forgive the pun  O0 )

  • Like 5

Share this post


Link to post
Share on other sites

Adrian, you can already change the author of the post..unless am not getting you? Check the settings tab when editing a blog post page

Sorry - I haven't actually implemented your blog profile on a site yet, so I forgot about that!

Agreed. This might be a valid solution for the user-specificity part, though "regular" bloggers probably shouldn't have the permission to do this -- right?

Whether this solves the question of having multiple separate blogs still doesn't seem entirely obvious to me. In another system we've used it was possible to create and embed separate blogs, with their own names and other settings, to different parts of the site. That was pretty handy, actually. Each blog being tied to one user account (in a way that made it impossible to change later) was the problematic part.

If only we could somehow had both.. :)

Edit: I'll have to take a closer look at post settings based on @kongondos reply above, but just wanted to clarify the part about "regular bloggers' permissions". In our case bloggers are sometimes actually users that have absolutely no other permissions -- can't edit content etc. Them being able to edit other bloggers' posts or change authors of those would be far from optimal. Could be specific to our case, though..

In Wordpress regular bloggers can't change the author - it requires an editor (or maybe admin, I don't remember) level permission setting.

Share this post


Link to post
Share on other sites

This module looks awesome - thanks hugely for sharing :)

Could I ask (pretty new to Processwire so apologies if this is easy or not possible or anything like that). Would it be possible to modify the post URI so that instead of something like /blog/posts/this-is-a-post you could have something like /blog/2014/06/this-is-a-post

So essentially it'd categorize the posts into year and month. This is similar to how Wordpress and a couple of other CMS/Blog systems do it as default, and it's pretty handy as if you've got 2 posts with the same name, they are less likely to clash if you're also including/checking the month/year.

Also, I read through the thread and saw a mention of having a publish date/time - has this been implemented? If not I'm probably going to be doing some work on a few of my own modules in the next week or two, so would be happy to see about doing a pull request with it as it's something I'll need to add anyway :)

Hi Rickm,

Glad you are liking the module.

URI:

I see your point. There was a similar request a couple of posts further up. My response then and still is that this is one of those things where people have different preferences. Sorry, for now, I am leaving it up to the user to manipulate the URL segment if they so wish.

Publish date/time:

I haven't had time to implement this yet (sorry, distracted by football currently  :P) but it's on my TODO list. 

Thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
    • By EyeDentify
      Hello There Guys.

      I am in the process of getting into making my first modules for PW and i had a question for you PHP and PW gurus in here.

      I was wondering how i could use an external library, lets say TwitterOAuth in my PW module.
      Link to library
      https://twitteroauth.com/

      Would the code below be correct or how would i go about this:
      <?PHP namespace ProcessWire; /* load the TwitterOAuth library from my Module folder */ require "twitteroauth/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; class EyeTwitter extends WireData,TwitterOAuth implements Module { /* vars */ protected $twConnection; /* extend parent TwitterOAuth contructor $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token, $access_token_secret); */ public function myTwitterConnection ($consumer_key, $consumer_secret, $access_token, $access_token_secret) { /* save the connection for use later */ $this->twConnection = TwitterOAuth::__construct($consumer_key, $consumer_secret, $access_token, $access_token_secret); } } ?> Am i on the right trail here or i am barking up the wrong tree?
      I don´t need a complete solution, i just wonder if i am including the external library the right way.
      If not, then give me a few hint´s and i will figure it out.

      Thanks a bunch.

      /EyeDentify
    • By Violet
      Here I'm introducing FlipFall Magazine, our multi-topic blog. It used to run on Wordpress but we recently switched it to ProcessWire. This was done the usual way we do it when converting our sites: install ProcessWire in a subfolder of the original Wordpress site under a hard-to-guess name, set up the new site there, then move content over manually, inspecting and updating each article as needed. After the ProcessWire site was ready, when we un-installed the Wordpress one and moved the ProcessWire site up one level to the document root, and... done.
      We used the W3CSS framework because it handles the responsive breakpoints so well (no extra work for us 😉), and it tends to default to a clean modern look.
      We wanted full control over the back end of the site and do customized things without having to hire a developer.  As FlipFall has grown, the ability to have in-house back-end control has become even more important.
      Case example: Ad partners - we now can quite easily, if we wish, place different ads on different topics on this blog at a moment's notice - no need to hire a developer. Changes like this can be implemented in-house right away. The fact that we can easily incorporate this sort of thing is really nice when we're talking with potential ad partners.
      Helpful features of ProcessWire during this experience:
      The ability to export and import fields in PW was key here. We had a few other article-style sites I had done in PW recently, so having the same types of templates was very helpful. We were able to export fields and templates from our existing sites and import into FlipFall as a starting base point. No need to re-invent the wheel here! Another helpful ability of PW was when we were dealing with the categories. We built the site without category templates (but with the category page field), then added the templates in later as needed - no disruption. In other words, a template-less page field worked perfectly for the categories until we needed the template, then we just created the template. Not every feature of the site needs to be thought out in absolute full beforehand, some can be added in later as needed. Very extensible and convenient. Internal links within blog posts worked well using the page select option in the link button on the editor. When moving out of staging folder and into document root, the links auto-updated, which was nice. Creating new articles is a breeze, because under PW our fields are now customized for our needs: we created all of the fields we need and none of the ones we don't. Again, this is unlike most blogging CMS's, where they try to guess what you want (and usually get it wrong). Even for people who are solely doing blogs/article sites, I feel that ProcessWire is a much better option than most blog-specific platforms, because of PW's flexibility.  The only thing I miss about Wordpress is the ability to auto-schedule post publication, which for the serious blogger is important. For example, there were some occasions on some of our other blogs where we needed to schedule posts to auto-publish at 3:01am Eastern Time to allow a time-sensitive post to come out as early in time of day as possible on publication date (3:01 am US Eastern time ensures it's that same day 12:01 am on Pacific time). We were delighted to see that ProcessWire is much, much lighter on resources of the hosting environment than the same site on Wordpress - we could see this empirically on our web hosting stats before and after the switch.
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
      As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend
       

×
×
  • Create New...