Jump to content

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.

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

 

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

 

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

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.

 

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.

Link to post
Share on other sites
  • 2 weeks later...

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?

 


 

 


 

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
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
Link to post
Share on other sites
  • 1 month later...

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.

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.

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) 

 

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

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
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►

 

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 monollonom
      (once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website 😅. Thx @teppo !)
      Github: https://github.com/romaincazier/FieldtypeQRCode
      Modules directory: https://processwire.com/modules/fieldtype-qrcode/
      This is a simple module I made so a client could quickly grab a QR Code of the page's url in the admin.
      There's not much to it for now, but if need be you can output anything using a hook:
      $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $event->return = "Your custom text"; }) You can also output the QR code on your front-end by calling the field:
      echo $page->qr_code_field; The module uses the PHP library QR Code Generator by Kazuhiko Arase. When looking for a way to generate a QR Code in PW I came across @ryan's integration in his TFA module. I'm not very familiar with fieldtype/inputfield module development so I blindly followed @bernhard (great) tutorial and his BaseFieldtypeRuntime. At some point I'll take a deeper look to make a module on my own.
      Some ideas for improvements :
      add the ability to choose what to ouput : page's url / editUrl / file(s) / image(s) / ... allow to output multiple QR codes ?
    • By Chris Bennett
      https://github.com/chrisbennett-Bene/AdminThemeTweaker
      Inspired by @bernhard's excellent work on the new customisable LESS CSS getting rolled into the core soon, I thought I would offer up the module for beta testing, if it is of interest to anyone.

      It takes a different approach to admin styling, basically using the Cascade part of CSS to over-ride default UiKit values.
      Values are stored in ModuleConfig Module creates a separate AdminThemeTweaker Folder at root, so it can link to AdminThemeTweaker.php as CSS AdminThemeTweaker.php reads the module values, constructs the CSS variables then includes the CSS framework Can be switched on and off with a click. Uninstall removes everything, thanks to bernhard's wonderful remove dir & contents function.
      It won't touch your core. It won't care if stuff is upgraded. You won't need to compile anything and you don't need to touch CSS unless you want to.

      It won't do much at all apart from read some values from your module config, work out the right CSS variables to use (auto contrast based on selected backgrounds) and throw it on your screen.
      You can configure a lot of stuff, leave it as it comes (dark and curvy), change two main colors (background and content background) or delve deep to configure custom margins, height of mastheads, and all manner of silly stuff I never use.

      Have been developing it for somewhere around 2 years now. It has been (and will continue to be) constantly tweaked over that time, as I click on something and find something else to do.
      That said, it is pretty solid and has been in constant use as my sole Admin styling option for all of those 2 years.

      If nothing else, it would be great if it can provide any assistance to @bernhard or other contributor's who may be looking to solve some of the quirkier UiKit behavior.
      Has (in my opinion) more robust and predictable handling of hidden Inputfields, data-colwidths and showIf wrappers.
      I am very keen to help out with that stuff in any way I can, though LESS (and any css frameworks/tools basically) are not my go.
      I love CSS variables and banging-rocks-together, no-dependency CSS you can write with notepad.



       

    • By opalepatrick
      I see old posts saying that repeaters are not the way to go in Custom Process Modules. If that is the case, when using forms (as I am trying to do) how would one tackle things like repeat contact fields where there can be multiple requirements for contact details with different parameters? (Like point of contact, director, etc) or even telephone numbers that have different uses?
      Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.
      Maybe I am thinking about this incorrectly?
    • By HMCB
      I ran across a reference to IftRunner module. The post was 6 years ago. I cant find it in available modules. Has it been pulled?
    • By tcnet
      PageViewStatistic for ProcessWire is a module to log page visits of the CMS. The records including some basic information like IP-address, browser, operating system, requested page and originate page. Please note that this module doesn't claim to be the best or most accurate.
      Advantages
      One of the biggest advantage is that this module doesn't require any external service like Google Analytics or similar. You don't have to modify your templates either. There is also no Javascript or image required.
      Disadvantages
      There is only one disadvantage. This module doesn't record visits if the browser loads the page from its browser cache. To prevent the browser from loading the page from its cache, add the following meta tags to the header of your page:
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> How to use
      The records can be accessed via the Setup-menu of the CMS backend. The first dropdown control changes the view mode.

      Detailed records
      View mode "Detailed records" shows all visits of the selected day individually with IP-address, browser, operating system, requested page and originate page. Click the update button to see new added records.

      Cached visitor records
      View modes other than "Detailed records" are cached visitor counts which will be collected on a daily basis from the detailed records. This procedure ensures a faster display even with a large number of data records. Another advantage is that the detailed records can be deleted while the cache remains. The cache can be updated manually or automatically in a specified time period. Multiple visits from the same IP address on the same day are counted as a single visitor.

      Upgrade from older versions
      Cached visitor counts is new in version 1.0.8. If you just upgraded from an older version you might expire a delay or even an error 500 if you display cached visitor counts. The reason for this is that the cache has to be created from the records. This can take longer if your database contains many records. Sometimes it might hit the maximally execution time. Don't worry about that and keep reloading the page until the cache is completely created.
      Special Feature
      PageViewStatistic for ProcessWire can record the time a visitor viewed the page. This feature is deactivated by default. To activate open the module configuration page and activate "Record view time". If activated you will find a new column "S." in the records which means the time of view in seconds. With every page request, a Javascript code is inserted directly after the <body> tag. Every time the visitor switches to another tab or closes the tab, this script reports the number of seconds the tab was visible. The initial page request is recorded only as a hyphen (-).

      Settings
      You can access the module settings by clicking the Configuration button at the bottom of the records page. The settings page is also available in the menu: Modules->Configure->ProcessPageViewStat.
      IP2Location
      This module uses the IP2Location database from: http://www.ip2location.com. This database is required to obtain the country from the IP address. IP2Location updates this database at the begin of every month. The settings of ProcessPageViewStat offers the ability to automatically download the database monthly. Please note, that automatically download will not work if your webspace doesn't allow allow_url_fopen.
      Dragscroll
      This module uses DragScroll. A JavaScript available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability in view mode "Day" to drag the records horizontally with the mouse pointer.
      parseUserAgentStringClass
      This module uses the PHP class parseUserAgentStringClass available from: http://www.toms-world.org/blog/parseuseragentstring/. This class is required to filter out the browser type and operating system from the server request.
×
×
  • Create New...