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

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

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

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 Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.56
      Composer: rockett/jumplinks
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! :)
    • By BitPoet
      As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now:
      InputfieldSlideToggle
      Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary.
      Status
      Still very alpha, use with caution!
      Features / Field Settings
      Size
      You can render the toggles in four different sizes: small, medium, large and extra large.
      Off Color
      Currently, "unchecked" toggles can be displayed either in grey (default) or red.
      On Color
      "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red.
      Screenshots

      Some examples with checkbox label


      View all Size and Color Combinations
      Small toggles Medium toggles Big toggles Extra big toggles  









    • By Orkun
      Hi Guys
      I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer.
      So I duplicated the module and placed it under /site/modules/.
      I have added 3 new Settings to the InputfieldDatetime Module.
      1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING

       
      2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING

       
      3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY

       
      The Problem
      Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right.
      What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select.
      But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again.
      The time select doesn't get change when you select a date 1 time and don't close the picker.
      Here is the whole extended InputfieldDatetime Module.
      The Files that I have changed:
      InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version  
      Thats the Part of the JS that is not working correctly:
      if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is?
      InputfieldDatetime.zip
       
      Kind Regards
      Orkun
    • By teppo
      This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened.
      At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide
      https://modules.processwire.com/modules/process-changelog/
      https://github.com/teppokoivula/ProcessChangelog
      How does it work?
      Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table.
      How do you use it?
      When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while.
      For detailed installation instructions etc. see README.md.
       


    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




×
×
  • Create New...