Jump to content

Recommended Posts

Thanks for the info kongondo :)

For anyone wanting a 'quick hack for now' for setting the published date, run through the MarkupBlog.module file, and the template files and find:

find("template=blog-post

and immediately after add this:

, blog_date<=".date('Y-m-d G:i:s')."

This will basically add a condition to the post (aka page) lookup, to make sure the date field is set to now, or lower. I've run some tests on my local copy and it's working as expected.

Share this post


Link to post
Share on other sites

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

I haven't made a decision on this yet. On the one hand I don't want to reinvent the wheel; why not just use SchedulePages. On the other, I am a bit wary of tying an important functionality of Blog to a third party module that is not part of the core. In case things were to break in the future and they were not fixed (no offence meant to Jasper), that would leave Blog users hanging.....Maybe I am being over cautious. I'll make a decision soon...

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

Admittedly I currently have no idea how I could implement such a feature and to be honest, I haven't thought much about it. Where would the posts, tags and categories  live on the tree for the different blogs? It could get messy very quickly. Anyway, any and all ideas are welcome, thanks! 

Share this post


Link to post
Share on other sites

For the curios, auto-publish date will either have to be set via API using a small auto-load module triggered via cron or via the module SchedulePages. As stated above, I am yet to decide which route to take...

Share this post


Link to post
Share on other sites

On the one hand I don't want to reinvent the wheel; why not just use SchedulePages. On the other, I am a bit wary of tying an important functionality of Blog to a third party module that is not part of the core. In case things were to break in the future and they were not fixed (no offence meant to Jasper), that would leave Blog users hanging.....Maybe I am being over cautious.

Nothing wrong with being careful, but luckily we're talking about free software here. If it's any more reassurance, we've got a lot of sites relying on this module already, so trust me: in the (unlikely) scenario that something was to happen and the module wasn't kept up to date, I for one would be more than happy (and forced, actually..) to catch the ball ;)

  • Like 3

Share this post


Link to post
Share on other sites

We (Avoine) have the (hairy) balls also in ScheludedPages basket.

  • Like 2

Share this post


Link to post
Share on other sites

This post is in response to this question posted on GitHub

Comment Layout

I'm using Foundation instead of Skeleton and need to tweak some of the layout.
Can you identify which file I would need to tweak to change the comments layout? I can do so much via CSS but not the bigger shifting around of content

First, I'd like to reiterate that this Blog Module does not use any CSS framework. The Blog (site) Profile (on which Blog Module is based) uses the Skeleton CSS framework. However, in this Module's demo/example output/template files, I have used PocketGrid CSS. It is not a requirement. You can use whichever CSS framework (or not) you wish. The following example is for this module (but is equally applicable to the Blog Profile).

It is very easy to style Blog's comments by targeting the output HTML IDs and Classes in your CSS. In my example template files, my custom styles are in blog.css. The example code below is an HTML output of Comments where 'comments are allowed'.

<div id="comments">
	<span class="num-comments-icon">2</span>
	<h4>Comments</h4>
	<ul class="comments CommentList">
		<li class="comment CommentListItem" id="comment1">
			<p class="comment-head CommentHeader">Comment by kongondo on 13 April 2014 11:16 pm</p>
			<div class="comment-body CommentText"><p>Simply the best CMS.</p></div>
		</li>

		<li class="comment CommentListItem" id="comment10">
			<p class="comment-head CommentHeader">Comment by kongondo on 23 May 2014 2:42 pm</p>
			<div class="comment-body CommentText"><p>ProcessWire rocks, yeah!</p></div>
		</li>

	</ul>
	<!--CommentForm-->
	<div id="CommentForm" class="CommentForm_new">
		<h4>Post a comment</h4>
		<form id="CommentForm_form" action="./#CommentForm" method="post">
			<p class="CommentForm_cite">
				<label for="CommentForm_cite">Your Name</label>
				<input type="text" name="cite" class="required" required="required" id="CommentForm_cite" value="" maxlength="128">
			</p>
			<p class="CommentForm_email">
				<label for="CommentForm_email">Your E-Mail</label>
				<input type="text" name="email" class="required email" required="required" id="CommentForm_email" value="" maxlength="255">
			</p>
			<p class="CommentForm_text">
				<label for="CommentForm_text">Comments</label>
				<textarea name="text" class="required" required="required" id="CommentForm_text" rows="5" cols="50"></textarea>
			</p>
			<p class="CommentForm_submit">
				<button type="submit" name="CommentForm_submit" id="CommentForm_submit" value="1">Submit</button>
				<input type="hidden" name="page_id" value="2488">
			</p>
		</form>
	</div><!--/CommentForm-->
</div> 

So, you do not need to tweak any file. All you need is to style the output.

For the PHP stuff, I am in the process of writing some documentation...

Hope this answers your query. Thank you for using Blog :-)

  • Like 4

Share this post


Link to post
Share on other sites

Cheers for the reply and apologies re the framework mixup.

I guess I'm approaching this with a few expectations picked up from my other blogging platform. Within that, almost every part of the blog was a mini template which you could tweak to make fundamental layout changes.

Share this post


Link to post
Share on other sites

Sparrow, no need to apologise for anything :-). Your question will help the next guy. Once I write the API documentation, you'll realise that you can also tweak this Blog to make fundamental layout changes. You can output bits and pieces (tags, posts, categories, authors, comments, etc) anywhere using its API since it is a PW module. All these bits and pieces are independent of each other. This is similar to PW pages in the sense that you can output page fields anywhere in any order in your site or even not output any of the fields.

  • Like 2

Share this post


Link to post
Share on other sites

ABSO-FREAKING-LUTELY BEAUTIFUL!!!!!!!

Seeing all those screenshots gets me all excited amigo :) 

Thank you for a job well done. This comes in perfect timing for a new project that I started yesterday. GEEZZZ, p-e-r-f-e-c-t.

  • Like 1

Share this post


Link to post
Share on other sites

@OrganizedFellow

Thanks. Glad you like the module. You've been away a while... ;):)   

  • Like 1

Share this post


Link to post
Share on other sites

@OrganizedFellow

Thanks. Glad you like the module. You've been away a while... ;):)   

Work. Lots of it. Two new PW sites. Hopefully worthy of sharing for the Showcase :) 

  • Like 1

Share this post


Link to post
Share on other sites

Update:

Minor version bump to 1.2.1 after some minor styling issues updates.

Documentation:

I am taking a short break from writing code to write some badly needed documentation for Blog (and some other PW tutorials if I get time :-)). I am writing this documentation as tutorials which I will post on my website soon. I'll keep you updated. I haven't forgotten any Blog features pending requests :-)

  • Like 4

Share this post


Link to post
Share on other sites

Thank you Kongondo and Ryan for these excellent modules!

I've implemented this into a site I'm developing and am having an issue... The blog posts are not truncating. I have the summary length set to 150 , but nothing is being truncated. I know when i created a post I'm populating the "blog_body" field and these settings seem to be for the "blog_summary" field (which does is not one of the fields for the template).. From what I can see in the MarkupBlog.module, there is a conditional if summary is empty to pull from the blog_body and truncate.

The blog I'm working on is here: http://shootkta.info/blog/ .. If you have any thoughts, please let me know.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Webweaver,

Glad you like the module.

It is truncating fine for me here. The code is pulling text to truncate from blog_body. I decided to skip over using a blog_summary since truncation can be done from blog_body. I am guessing it is not truncating because you have not set the second parameter/argument of renderPosts() to true. The default is false (i.e. do not truncate). Apologies for this; I have delayed with documentation but I am currently writing this. Here's example code to make it truncate.

$blog = $modules->get("MarkupBlog");
$limit = 10;
//limit will be passed to the selector fetching blog posts;
//'true' will truncate posts to what we have set in blog_quantity but default to 450 if this is not set
$content = $blog->renderPosts("limit={$limit}", true);
echo $content;
  • Like 1

Share this post


Link to post
Share on other sites

Kongondo, is your blog module out of beta and can be used already safe ?

I read a lot of good things about your blog modules and are going to install

them this week-end.

  • Like 1

Share this post


Link to post
Share on other sites

Still in Beta but safe to use but I need to add some features before going stable (e.g. scheduled publishing, etc) :-). Other than that, it works fine...

  • Like 2

Share this post


Link to post
Share on other sites

@Kongondo - Thank you very much for the explanation to fix. Next time I'll know not to pull my hair out for 2 hours and just ask the question and wait for the reply :)

Btw, the generated summary strips out all tags so the posts in the blog list looked pretty bad.. So I removed the strip tags.. But then had another problem - if the cutoff was in the middle of an anchor tag, the "view more" anchor tag would become nested and didn't work.. So I put back in the strip tags but allowed <p> and <img> tags.. The summaries in the blog list look much nicer now.

ex: Line 543 in MarkupBlog.module now reads:

$summary = strip_tags(substr($page->blog_body, 0, $summaryLimit), '<p><img>');

Share this post


Link to post
Share on other sites

As for <p></p>, those are added back later. See line 602 of the code

if($small) {

  $out .= "<p>" . $page->summary . "… <a class='more' href='{$page->url}'>" . __('View More') . "</a></p>";
} 

Hadn't considered images in the summary.... :-)..Maybe I'll need to add at blog_summary [non-rich text area] to the blog template.

Edit

Or, for now, maybe not. I don't want to add too many fields...I'll have a think

Edit 2:

We now have this feature inbuilt in renderPosts(). You can specify tags that should not be stripped as indicated in this post:

https://processwire.com/talk/topic/7403-module-blog/?p=78227 (see  post_small_allowable_tags)

Edited by kongondo

Share this post


Link to post
Share on other sites

Ya, I hesitated on the img tag :) Basicly I want them to see a majority of the post in full formatting (as much as possible) while they are on the blog listing page.

But line 602 is surrounding the entire post in a paragraph, so there is still no formatting within it. The paragraphs within the post itself were getting stripped.

I should mention also that I enabled CKEditor in for the blog_body field and changed the code in ProcessBlog.module for quickpost_body to use CKEditor also (line 387), but the tags were being stripped from the quickpost CKEditor, so had removed the sanitizer from quickpost (line 1441).

Share this post


Link to post
Share on other sites

Btw, I think I may have found a bug - In the posts dashboard I can't sort by Date properly.

date_sort_bug.jpg

  • Like 1

Share this post


Link to post
Share on other sites

More on Date sorting.. It seems once I open a post, then close, it sorts correctly in descending order. But I can't sort by ascending and when I click on the Date column header it doesn't sort on the fly. All the other columns work fine.

  • Like 1

Share this post


Link to post
Share on other sites

Forgot to ask, if I install a fresh processwire 2.4 and the 2 blog modules,

how does the blog show up on the front ? I mean a fresh pw 2.4 install

has it´s own default front with nav, body and sidebar. How does the blog

integrate with this ?

Edit1:

Got it, installing and just saw the blog template files, css and js.

It is really complete !

How can I disable the default front that came during the processwire install

and only have the basic blog front ?

uploaded all the php blog files to /site/templates/

and in admin tried to change template for home to blog.php

but didn´t allow me.

Ok dumb me, just had to delete home.php and rename blog.php to home.php

Now I can start building up :) it´s using pocketgrid so that is a real bonus.

In the admin I saw a new tab named Blog will all the great config in it.

kongondo.jpg

Share this post


Link to post
Share on other sites

Guys, apologies for not responding earlier.

@Webweaver

I've had a thought about the 'summary' text and I want to leave it as is for now. My reckoning is that a summary is just that; a blurb of text (usually one paragraph)...

Thanks for reporting the issue with sorting the 'date' field. The Posts Table is being generated from ProcessWire (MarkupAdminDataTable). So, this is not an issue with ProcessBlog per se but thanks for catching that. I have actually been considering using other tables (e.g. DataTable) that are capable of dynamic sorting (i.e. sorting from the database). The sorting your see now is static and does not draw from the database. 

As for quickpost I have been wavering between making it RTE or not. I reckoned that many people would not be using it often for post creation. If there's sufficient demand I might change it back to RTE.

@Pwired

Glad you find the module useful. As stated in the first post, I intentionally used lots of template files in an attempt to make it easier for folks to see what's going on in the code. It is definitely not the recommended templating approach. In addition, using the Blog API, the user would be able to use the templating approach they wanted (as well as the CSS framework they wanted). However, documentation to assist users with the API is badly needed (and I am working on this at the moment). So in time, you will be able to 'disable the default front' that comes with MarkupBlog. This means basically deleting the template files :-). Technically, Blog does not need any of those template files. They are just there to showcase its capabilities. 

OK, back to writing.... :-)

Share this post


Link to post
Share on other sites

@kongondo: sorry if this is unrelated (I don't have a proper test environment at hand right now) but sorting by dates is entirely doable using MarkupAdminDataTable too. It just requires a bit of extra work: prefixing actual, visible value with hidden, sortable value; something like yyyy-mm-dd etc.

This is how I solved it in ProcessLoginHistory.

Sorting multi-page values is another issue entirely, but as far as sorting visible results is good enough, no need to complicate things with new 3rd party components :)

  • Like 2

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      TrelloWire
      This is a module that allows you to automatically create Trello cards for ProcessWire pages and update them when the pages are updated. This allows you to setup connected workflows. Card properties and change handling behaviour can be customized through the extensive module configuration. Every action the module performs is hookable, so you can modify when and how cards are created as much as you need to. The module also contains an API-component that makes it easy to make requests to the Trello API and build your own connected ProcessWire-Trello workflows.
      Features
      All the things the module can do for you without any custom code: Create a new card on Trello whenever a page is added or published (you can select applicable templates). Configure the target board, target list, name and description for new cards. Add default labels and checklists to the card. Update the card whenever the page is updated (optional). When the status of the card changes (published / unpublished, hidden / unhidden, trashed / restored or deleted), move the card to a different list or archive or delete it (configurable). You can extend this through hooks in many ways: Modifiy when and how cards are created. Modify the card properties (Target board & list, title, description, et c.) before they are sent to Trello. Create your own workflows by utilizing an API helper class with many convenient utility methods to access the Trello API directly. Feedback & Future Plans
      Let me know what you think! In particular:
      If you find any bugs report them here or on Github, I'll try to fix them. This module was born out of a use-case for a client project where we manage new form submissions through Trello. I'm not sure how many use-cases there are for this module. If you do use it, tell me about it! The Trello API is pretty extensive, I'll try to add some more helper methods to the TrelloWireApi class (let me know if you need anything in particular). I'll think about how the module can support different workflows that include Twig – talk to me if you have a use-case! Next steps could be a dashboard to manage pages that are connected to a Trello card, or a new section in the settings tab to manage the Trello connection. But it depends on whether there is any interest in this 🙂 Links
      Repository on Github Complete module documentation (getting started, configuration & API documentation) TrelloWire in the modules directory Module configuration

    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-04-06 -- SnipWire 0.8.6 (beta) released! Adds support for Snipcart subscriptions and also fixes some problems 2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By bernhard
      #######################
      Please use the new RockFinder2
      #######################
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://github.com/BernhardBaumrock/RockFinder
       
      Changelog
      180817, v1.0.6, support for joining multiple finders 180810, v1.0.5, basic support for options fields 180528, v1.0.4, add custom select statement option 180516, change sql query method, bump version to 1.0.0 180515, multilang bugfix 180513, beta release <180513, preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By MoritzLost
      Process Cache Control
      This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Plans for improvements
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots


    • By Macrura
      PrevNextTabs Module
      Github: https://github.com/outflux3/PrevNextTabs
      Processwire helper modules for adding page navigation within the editor.
      Overview
      This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)
      Usage
      This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.
      Warnings
      If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.
      For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.
      http://modules.processwire.com/modules/prev-next-tabs/
×
×
  • Create New...