Recommended Posts

Hi,

I really like this module.

I was wondering if it is possible to add featured image field to blog posts? I'm sure it is possible but don't know in which template file should I add new image field so it is available in all posts as featured image right after title of post.

Thanks.

Share this post


Link to post
Share on other sites

Welcome to the forums @DarkwaveSurfer,

Glad you are finding the module useful. The template would be 'blog-post'. But you already have an image field in that template, so why add another? In addition, Blog already has a featured image feature. Sorry the docs are not up to date. Please have a read from this post forward..You have fine-grained control where to show your featured image, whether it comes from the image field or the RTE.

 

  • Like 1

Share this post


Link to post
Share on other sites

@kongondo

Thanks for the reply. I'm new with php and Processwire so I need a little help.

I managed to show featured image from "images field" in recent posts widget like this (on my Home page):

$blog = $modules->get("MarkupBlog");
$options = array('width'=>350, 'alt'=>'title', 'post_small_image' => 1, 'post_large_image' => 1, 'post_comments' => 0);
$content = $blog->renderPosts("limit=2", true, $options);
echo $content; 

But image from "images field" doesn't appear when I enter Blog post or in Blog page (list of all posts). How do I show image on those pages?

Also, can the featured image be placed after the post title? At the moment it is before title.

Thanks.

 

Share this post


Link to post
Share on other sites

@DarkwaveSurfer,

Please see post:

post_small_image only works when the second parameter of renderPosts() is true (like in your case, so it should work...hmmm). Try removing the post_large_image from the options if you are using post_small_image. I haven't looked at the module in a while so I'll need to re-educate myself with some of the options :-X:P. Have you tried post_small_image => 2? That should display (IIRC) the featured image after the post title.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, firstly thanks for the awesome module!

Just wondering if I install using the second format style so everything is housed in a '/blog' directory... can I then move that blog directory from the root without wrecking anything? My site structure is along the lines of www.root.com/resources/blog/

Much appreciated,

Brett

 

Share this post


Link to post
Share on other sites

Hi @Barido. Welcome to the forums. Glad you find the module useful. That should be fine since MarkupBlog finds the 'main' Blog pages by their IDs (e.g. Blog, Blog Posts, Blog Settings, etc). You will want to backup everything first before attempting that move though, just in case...

Cheers,

/k

Share this post


Link to post
Share on other sites
On 29/10/2016 at 10:31 AM, kongondo said:

Thanks @kongondo - Had a few issues with the 3.0 install when comments were disabled. Looks like someone has brought that up on the GIT page though. Might try again when/if it gets legit 3.0 compatibility. Using a custom solution for now.

 

Share this post


Link to post
Share on other sites
On 11/10/2016 at 6:55 AM, BitPoet said:

Always happy to help :)

For anybody who feels daring and wants to try it, you can find the patched module here until kongondo finds the time to test my changes. Use at your own risk ;)

 

For me, it works perfect, congratulations.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, I am looking for the option to put the class='post-byline' after the content of the post.

I found the code, but I don't know where to change the variable $option.

$author = $options['post_author'] == 1 ? "<span class='author'>" . $options['post_author_text'] . " " . "<a href='{$page->authorURL}'>{$page->authorName}</a></span> " : '';
$date = $options['post_date'] == 1 ? "<span class='date'>" . $options['post_date_text'] . " " . $page->blog_date . "</span>" : '';

I found the way the change it using the "hard way". I mean by deleting the $options['post_author'] == 1 and everything but I would like to know where is that option.

Thanks in advance.

Share this post


Link to post
Share on other sites

Could I use Hanna Code inside the blog post?

I am trying to use some and the post doesn't recognize them.

I looked for in this topic but I didn't find anything useful... maybe I am not using the right words. Sorry for the inconvenience.

Share this post


Link to post
Share on other sites
10 hours ago, antoiba86 said:

Could I use Hanna Code inside the blog post?

Have you added TextformatterHannaCode to the blog_body field's configuration?

  • Like 1

Share this post


Link to post
Share on other sites

Hi,
Good to have a forum , i tried to install Processblog for PW3.0 from modules page , it no work.
Than i found  BitPoet version for PW3 here, thanks a lot.

I met some troubles with home page   and  messing with permissions for blog authors.

Is there a way to implement "most popular posts" functionality?

 


 

 


 

Share this post


Link to post
Share on other sites
40 minutes ago, ak1001 said:

Is there a way to implement "most popular posts" functionality?

That depends on the exact definition of "most popular". If its just the number of  visitors for each post, you could add a visit_counter field to the blog_post template and include the code shown in this post in blog_post.php which increments the counter with each new view per session:

Then you could simply run a selector with "template=blog-post, sort=-visitor_counter, limit=x" to show the top x most visited posts. To get it visible:

  • use one of the templates like blog-recent-posts
  • copy it and its PHP file to blog-popular-posts
  • adapt the selector in the PHP file like above
  • create and publish a page "Popular Posts" for the new template
  • and finally add "blog-popular-posts" to the $template array in blog-main.inc (line 16) so it shows up in the navigation

(untested!)

  • Like 2

Share this post


Link to post
Share on other sites

Update: Blog 2.4.0

Changelog

  1. Fixed SQL error thrown when comments disabled and accessed blog dashboard. Thanks @justb3a
  2. Added capability to copy demo JS and CSS files on blog install as well as remove them on uninstall.
  3. Full compatibility with ProcessWire 2.8.x and ProcessWire 3.x. Thanks to @BitPoet
Happy then to announce that I've tested and can confirm that Blog is compatible with ProcessWire 2.8.x and ProcessWire 3.x 
  • Like 5

Share this post


Link to post
Share on other sites
2 hours ago, kongondo said:

Happy then to announce that I've tested and can confirm that Blog is compatible with ProcessWire 2.8.x and ProcessWire 3.x 

@kongondo and @BitPoet, thank you guys VERY much for this—v3 compatibility, brilliant! ^_^

Share this post


Link to post
Share on other sites

Hi @kongondo 

I'm trying to install the blog, and have read all the installation instructions and following them to the T, but somehow I'm getting stuck after the second step. When I press the "run install wizard" button it doesn't show me the blog dashboard, instead it says "The process returned no content."

For installation I'm choosing

  • Style 1
  • Enabling comments
  • Template files with demo blog
  • RTE in quick post

When I want to uninstall I don't see the "cleanup" in the blog menu either.

What am I doing wrong? Please help.

Share this post


Link to post
Share on other sites

@MaryMatlow. Not a great start, eh? :). I can't recall having seen such an error before in respect of Blog. What's your ProcessWire version? PHP version, etc? What does the PW error log say? With debug on, do you get any errors? You could also check errors with Tracy (a different module) if you have it installed.

Share this post


Link to post
Share on other sites

Oops! I upgraded to the latest version of Blog and get this fatal error, the site and admin is down:

Fatal error: Cannot redeclare class BlogPublishDate in /Applications/XAMPP/xamppfiles/htdocs/xxxxxxx/site/assets/cache/FileCompiler/site/modules/ProcessBlog/BlogPublishDate.module on line 23
Compile Error: Cannot redeclare class BlogPublishDate (line 23 of /Applications/XAMPP/xamppfiles/htdocs/xxxxxxx/site/modules/ProcessBlog/BlogPublishDate.module) 

 

Share this post


Link to post
Share on other sites

I'm not sure I follow. What do you mean you upgraded to the latest version of Blog. I assumed this was your first time installing Blog, hence had the latest version already? Did you follow the normal upgrade process or did you create a second blog folder under /site/modules/? If you have two Blog folders in there, that would lead to the the 'redeclare' error. Since you have the Fatal Error alongside the Compile Error, I don't think it is a compile issue, but a 'two-folders' issue. Perhaps you have a /site/modules/processblog/ and a /site/modules/blog/? If that's not the case, could you clear your cache (Refresh button when in Modules view). You might need to do that several times. 

I haven't tested Blog in 3.0.39, but did test in 3.0.42 so maybe that is not the issue. Please refresh the cache and try reinstalling. This time, install without enabling comments. Secondly, could you confirm that Blog components are installed, i.e. blog_xxx_fields and blog-xxx-templates. 

 

  • Like 1

Share this post


Link to post
Share on other sites

Ok, here's how it is. I had downloaded the Blog module some months ago and had been installing/uninstalling it. When in the "Upgrades" tab under Setup I was an available upgrade for the Blog I went ahead with it and the error occurred. You were right, it was the "two folders" problem. Anyway, I have deleted all the folders and files related to the Blog, have downloaded the latest version from GitHub and tried installing it, After the first step it gives me the following error:

Cannot install Blog templates. Some template names already in use. These are: blog, blog-archives, blog-authors, blog-categories, blog-category, blog-links, blog-post, blog-recent-posts, blog-recent-tweets, blog-tag, blog-tags, blog-widgets, blog-widget-basic, blog-settings, repeater_blog-links.

Cannot install Blog fields. Some field names already in use. These are: blog_body, blog_categories, blog_quantity, blog_date, blog_files, blog_headline, blog_href, blog_images, blog_links, blog_note, blog_summary, blog_tags, blog_small.

Is there a way to delete the templates and fields in one go? Or is there a way around this error. Thanks so much for your help.

Share this post


Link to post
Share on other sites

For now, maybe a manual upgrade is what you need, exactly what you are doing. 

Use this gist to cleanup, via the frontend as follows: 

  1. Copy the code into a template file
  2. Login as superadmin
  3. In the frontend, visit a page that uses that template and follow the instructions
  4. Revert your template file to what it was before step #1

I suggest you also clear your file compilter. You can then install Blog. There are no changes in the latest version that would stop Blog from installing (compared to the older version). In fact, the newest version was one to make it compatible with PW 3.X. Let us know how it goes. 

  • Like 1

Share this post


Link to post
Share on other sites

@kongondo When I run the cleanup script, it gives me this error:



User Error
Exception: Can't delete Page 1266 because it has one or more children. (in /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/PagesEditor.php line 986)

#0 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Pages.php(487): ProcessWire\PagesEditor->delete(Object(ProcessWire\Page), false, Array)
#1 [internal function]: ProcessWire\Pages->___delete(Object(ProcessWire\Page))
#2 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#3 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___delete', Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'delete', Array)
#5 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/site/assets/cache/FileCompiler/site/templates/featureList.php(155): ProcessWire\Wire->__call('delete', Array)
#6 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/site/assets/cache/FileCompiler/site/templates/featureList.php(155): ProcessWire\Pages->delete(Object(ProcessWire\Page))
#7 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/site/assets/cache/FileCompiler/site/templates/featureList.php(137): BlogCleanup->cleanUpRepeater()
#8 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/site/assets/cache/FileCompiler/site/templates/featureList.php(61): BlogCleanup->cleanUpPages()
#9 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/site/assets/cache/FileCompiler/site/templates/featureList.php(423): BlogCleanup->cleanUp(Object(ProcessWire\InputfieldForm))
#10 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/site/assets/cache/FileCompiler/site/templates/home.php(5): include('/Applications/X...')
#11 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/TemplateFile.php(268): require('/Applications/X...')
#12 [internal function]: ProcessWire\TemplateFile->___render()
#13 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#14 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___render', Array)
#15 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
#16 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/modules/PageRender.module(515): ProcessWire\Wire->__call('render', Array)
#17 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/modules/PageRender.module(515): ProcessWire\TemplateFile->render()
#18 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent))
#19 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#20 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___renderPage', Array)
#21 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array)
#22 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/WireHooks.php(629): ProcessWire\Wire->__call('renderPage', Array)
#23 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/WireHooks.php(629): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent))
#24 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array)
#25 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array)
#26 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Page->render()
#27 [internal function]: ProcessWire\ProcessPageView->___execute(true)
#28 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#29 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___execute', Array)
#30 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array)
#31 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/index.php(55): ProcessWire\Wire->__call('execute', Array)
#32 /Applications/XAMPP/xamppfiles/htdocs/yogaspace/index.php(55): ProcessWire\ProcessPageView->execute(true)
#33 {main} search►

 

Share this post


Link to post
Share on other sites

What is page with ID 1266. Is it a repeater page? Is it maybe in the trash? Either way, delete it manually and try again. 

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 Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.1.16
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
    • By MoritzLost
      UPDATE: I have published a stable version of this module!
      Discussion thread:
      Github: https://github.com/MoritzLost/TextformatterPageTitleLinks
      ---
      Hello there,
      I'm working on a tiny textformatter module that searches the text for titles of other pages on your site and creates hyperlinks to them. I'm not sure if something like this exists already, but I haven't found anything in the module directory, so I wrote my own solution 🙂
      It's not properly tested yet and is still missing some functionality I would like to implement, so at the moment it should be considered in BETA. Features include limiting the pages that will get searched by template, and adding a custom CSS class to the generated hyperlinks. As I'm writing this I noticed that it will probably include unpublished and hidden pages at the moment, so yeah ... it's still in development alright 😅
      You can download the module from Github:
      https://github.com/MoritzLost/TextformatterPageTitleLinks
      There's some more information in the readme as well.
      Anyway, let me know what you think! I'm happy about any feedback, possible improvements or ideas on how to improve the module. Cheers.
    • By Violet
      Here I'm writing up about my first ProcessWire site, Reached.space, a blog and directory about shops which offer international shipping. 
      I'm from The GrayFly Group, which is the registered trade name for GrayFly Stationery, LLC, a limited liability company registered in the state of Kentucky, USA. You might ask, why is a stationery company creating websites?! Well, in a way both activities are very similar: both activities have the goal of getting written messages across in a pleasing manner to the reader.
      With that out of the way, let's move on and explain what went on behind the scenes of the Reached.space site:
      Template
      I used a free CSS-based template from W3CSS at https://www.w3schools.com/w3css/w3css_templates.asp , using mainly the "Architect" template as the basis and modifying it as needed.
      Pagination
      The pagination feature of ProcessWire was very helpful here; I kept the home page to just two blogroll articles so that the reader was not overwhelmed, but upon pressing "more articles" the remainder of the blogroll is paginated with 4 articles to a page.
      Screen reader
      I made adjustments to my usage of the template to make it screen-reader-friendly. I used the Google Chrome extension to test out how the site would be handled with a screen reader.
      Security
      Security is always important, so I was thrilled to find a great all-in-one-place security guide in the ProcessWire docs at https://processwire.com/docs/security/ - I simply went through the guide and did what it said, using it as a checklist.  
      Modules
      As far as I'm aware, the only additional modules I used (that were not already activated by default in standard PW install) were the Upgrade and Upgrade Checker modules. The main reason for this was security considerations, but it was also an added convenience and peace of mind to have it check for updates every time I logged in.
      However, I did use additional software that was not modules, as described below.
      Other software - Simple HTML DOM
      Here I was very fortunate to receive help from the ProcessWire community on the forum. Due to the site's monetization model being affiliate marketing, I wished to make all my external links nofollow and target _blank by default. User @Robin S was instrumental in showing me how to do this using Simple HTML DOM in the forum post  https://processwire.com/talk/topic/17295-solved-how-to-make-external-links-nofollow-and-target-_blank-by-default-if-using-source-code-toggle-in-editor/
      Other software - Google Analytics cookie manager
      My site requirements for GDPR were specific enough that I felt I would rather develop my own code to handle Google Analytics tracking, which I'll describe here. I wanted to be certain GA tracking was disabled by default requiring opt-in, instead of opt-out. I also included in the Cookie Manager some written info about third party cookies (these are placed when clicking on affiliate links) and how the user can avoid such tracking (turn off third party cookies in their browser settings). 
      I also disabled front-end PW cookies as described here: https://processwire.com/talk/topic/15270-session-storage-and-lifetime/ 
      Google Analytics cookie settings
      The Google Analytics cookie setting code was done using JavaScript. I used a session storage variable to indicate whether the user had a) accepted GA tracking cookies b) declined them or c) had not made a choice yet. I also had to make some changes also to the <head> code to ensure Google Analytics cookies were not set unless the user had accepted them. 
      Efficiency - optimizing 404s
      I used the guide at https://processwire.com/blog/posts/optimizing-404s-in-processwire/ to sinkhole bot-driven 404 requests to a static 404 file. 
      Back office pic
      Below is an image of how ProcessWire allows helpful field descriptions and displays them when used in templates, so that when I come to actually use or enter content in fields I created months ago, I know what the ramifications are. Very helpful. Also, when using the back office I found the Reno admin theme to be very pleasing, efficient, and easy to use.

       
    • By blad
      Hi guys!
      I just uploaded a module to explore files based on elFinder. By default it will show the "Files" folder.
      Screenshots:

      Video:
       
      To do:
       More options To fix:
       The function of rotating or scaling an image fails  Image editors V 1.01 (view issue)
      Fixed the bug working with the Multi-Language support ( translation of folders ). Fixed the name of elfinder.en  Github:
      https://github.com/LuisSantiago/ProcessElFinder/
      I hope you like it.