Jump to content

Recommended Posts

1 hour ago, heliumrotator said:

Only the configuration looks very ugly. I don't know if this your new style or an accident. I saw that better in the official video:

The very ugly configuration is the new style (since a couple of versions back). What you saw in the (old) 'official' video is the old style.

Welcome to the forums 🙂.

Share this post


Link to post
Share on other sites

Thank you for fast you reply.

My first thought was that I did something wrong. For hours I've been looking for the fault. Until I realized that there is no fault. I would never have thought that it should look like this.

Is there a way to get the old style back?

   

Share this post


Link to post
Share on other sites

Hi all,
I am using the blog module, and I love it. Thank you @kongondo.
I have created some posts with featured images and it seems to work fine.
The featured image is displayed above the post-headline.
But if I chose a category and take a view at the blog-category template, the featured image is not displayed at the posts which are belongs to the category.
Probably I forgot something to set?

Thanks in advance for the help.

 

Blog/MarkupBlog: 2.4.2

ProcessWire 3.0.42. 

Share this post


Link to post
Share on other sites

Hello there,

I have added a Repeater field in the blog_post template. But when I go to Quick Post to add a post I don't see the Repeater field in the editor. Am I missing anything?

Share this post


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

I have added a Repeater field in the blog_post template. But when I go to Quick Post to add a post I don't see the Repeater field in the editor. Am I missing anything?

Currently, such 'user-added' fields are not supported in Quick Post. They can only be accessed when you edit the blog page normally. Maybe it's something I need to think about.

Share this post


Link to post
Share on other sites
On 5/29/2018 at 1:42 PM, St3f4n said:

But if I chose a category and take a view at the blog-category template, the featured image is not displayed at the posts which are belongs to the category.
Probably I forgot something to set?

Sorry, @St3f4n. I forgot to answer your question! Use post_large_image option for featured image in a non-summarised (i.e. large/full) post and post_small_image option for featured image in a small/summarised post (e.g. in the default blog-category template file). Does this help?

Welcome to the forums 🙂.

Share this post


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

Currently, such 'user-added' fields are not supported in Quick Post. They can only be accessed when you edit the blog page normally. Maybe it's something I need to think about.

Thanks @kongondo

Is there a way to add a new post other than "quick post'? I can see the Repeater field when I edit an existing post, but how do I access it when creating a new post?

Share this post


Link to post
Share on other sites
1 hour ago, MaryMatlow said:

Is there a way to add a new post other than "quick post'?

Yes, but only via the normal PW page tree.  Posts are just PW pages that use the template blog-post. I don't know what Blog style you used, but just add a child page to whoever the parent of pages using blog-post is. If using style 1 of Blog, then the parent should be the page Posts and it uses the template blog-posts. Adding a child to that parent page should automatically select the template blog-post for the children being added (i.e. individual posts).

Share this post


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

Yes, but only via the normal PW page tree.  Posts are just PW pages that use the template blog-post. I don't know what Blog style you used, but just add a child page to whoever the parent of pages using blog-post is. If using style 1 of Blog, then the parent should be the page Posts and it uses the template blog-posts. Adding a child to that parent page should automatically select the template blog-post for the children being added (i.e. individual posts).

Yes, of course. Thank you @kongondo 🙂

Share this post


Link to post
Share on other sites
On 1/20/2015 at 9:44 AM, kongondo said:

Pretty much, but with a few additions as well. I have created a Gist of the renderPosts() function here:

1

Hi kongondo, I've been trying to make this plugin work for two straight days and I'm not having much luck. 

I'm a bit of a noob when it comes to PHP but I'm usually able to stumble my way through. Can you provide an updated Gist? I'm thinking maybe this one is just too old and won't work with the latest version of your plugin. It seems like copying the renderPosts function to my _func.php file (instead of editing MarkupBlog.module) is the best way to do it so that my changes aren't overwritten when the plugin is updated. I've read this forum over and over, I hate to bother you but the documentation doesn't seem to be complete yet.

[UPDATE: I finally got the featured images to work - didn't realize I had to add the "featured" tag to the image - otherwise, I get an error].

Any chance you can provide a working Gist for each of the other properties? IE: categories, authors, archives, comments, tags, next/prev post, etc. -  I would like to modify them to match my theme in the same way I did with renderPosts.

Share this post


Link to post
Share on other sites
On 5/24/2018 at 3:49 PM, heliumrotator said:

Is there a way to get the old style back?

Not unless you roll back to previous versions or modify the module itself to your liking (being aware that any future updates will wipe out your changes unless you rename your module class and files).

 

On 7/15/2018 at 1:33 AM, Ben Sayers said:

I've read this forum over and over, I hate to bother you but the documentation doesn't seem to be complete yet.

Welcome to the forums @Ben Sayers. Yes, apologies for the documentation. Despite my best intentions, I've never been able to find time to complete it.

On 7/15/2018 at 1:33 AM, Ben Sayers said:

[UPDATE: I finally got the featured images to work - didn't realize I had to add the "featured" tag to the image - otherwise, I get an error].

Again, sorry about this. Docs should be clearer.

On 7/15/2018 at 1:33 AM, Ben Sayers said:

Any chance you can provide a working Gist for each of the other properties? IE: categories, authors, archives, comments, tags, next/prev post, etc. -  I would like to modify them to match my theme in the same way I did with renderPosts.

Not at the moment, I'm afraid. Any reason why you can't/won't use the Blog module itself to render your posts? The demo template files and the present documentation provide examples that should get you going.

Share this post


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

Not at the moment, I'm afraid. Any reason why you can't/won't use the Blog module itself to render your posts? The demo template files and the present documentation provide examples that should get you going.

I guess that's where the documentation would come in handy, I just don't understand how to use the Blog module... If I make changes to MarkupBlog.module, won't they be overwritten if I update your plugin in the future? The demo templates seem to be using the delayed output method which I don't know how to use. When I install PW, I use the "Beginner" option with Direct Output (head/foot includes). 

Share this post


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

If I make changes to MarkupBlog.module, won't they be overwritten if I update your plugin in the future

Yes, they would be overwritten.

2 hours ago, Ben Sayers said:

I guess that's where the documentation would come in handy, I just don't understand how to use the Blog module

I agree, however, the current Blog API documentation is sufficient to get you started, I would think 🙂.

2 hours ago, Ben Sayers said:

The demo templates seem to be using the delayed output method which I don't know how to use

True, but it shouldn't be a problem because the most important thing for you is to use Blog's own methods. E.g. renderPosts(), renderCategories(), etc. They'll still work irrespective of output method. Hence, the reason I pointed you to the examples in the demo template files.

Maybe if you could explain what exactly you need help with?

 

Share this post


Link to post
Share on other sites

I've just updated my PW to 3.0.98 and installed ProCache. Unfortunately now I'm getting a 404 on all blog pages. Also I see ProCache doesn't even list the blog templates.

Any advice?

Share this post


Link to post
Share on other sites
On 8/10/2018 at 3:25 PM, DarsVaeda said:

I've just updated my PW to 3.0.98 and installed ProCache. Unfortunately now I'm getting a 404 on all blog pages. Also I see ProCache doesn't even list the blog templates.

Any advice?

Hi @DarsVaeda,

I am totally clueless about this as I've never used ProCache. Could you disable ProCache and see if we can rule out the upgrade to PW 3.0.98 as the cause? Any errors? (use Tracy Debugger)

Share this post


Link to post
Share on other sites

I actually just found the error this morning. Whilst uploading something went wrong with file rights of the template. When going to the template it actually states so (that it can't access the template and no pages with that template will be displayed).

But on frontend it's just a 404 and no log entry. Would be nice to get that error as log entry so debugging is a bit easier.

Share this post


Link to post
Share on other sites
28 minutes ago, DarsVaeda said:

Whilst uploading something went wrong with file rights of the template.

So problem solved?

Share this post


Link to post
Share on other sites
8 minutes ago, DarsVaeda said:

yes fixing file rights fixed the 404

👍

Share this post


Link to post
Share on other sites

Hi Kongondo,

Thanks for this massive module! I've been away from PW for a while and finding this was a true gem.

How would we render just the Categories list with page count next to it without actual blog entries? Similar to /blog/categories/

I have tried setting the limit without much change:

$blog = $modules->get('MarkupBlog');

//number of posts to list per category
$limit = 0;

//get the categories page. 
$categories = $pages->get('/blog/categories/');

//Render list of categories showing a maximum of 0 posts titles per category
//children = the individual category pages
echo $blog->renderCategories($categories->children, $limit);

I could not see many parameters or examples in the docs.

Thanks so much!

 

Using  ProcessWire 3.0.98 and Blog Module 2.4.2

Edited by biotech
original issue solved

Share this post


Link to post
Share on other sites
On 8/29/2018 at 3:22 AM, biotech said:

Thanks for this massive module! I've been away from PW for a while and finding this was a true gem.

Glad you are finding it useful.

On 8/29/2018 at 3:22 AM, biotech said:

How would we render just the Categories list with page count next to it without actual blog entries? Similar to /blog/categories/

Currently, you can't. You can file it as a feature request though. Please file as an issue here.

Edit: Alternatively, you can do this easily yourself like so:

// get the categories page. 
$categories = $pages->get('/blog/categories/');
$out = '';

// @note: optionally limit these if there's lots of posts >>> children('limit=x')
foreach ($categories->children as $category) {
    $categoryPostsCount = $pages->count("template=blog-post, blog_categories=$category, sort=-blog_date");
    // append category title and link
    $out .= "<h3><a href='$category->url'>$category->title</a></h3>";
    $out .= "<span>$categoryPostsCount</span>";
}


echo $out;

 

On 8/29/2018 at 3:22 AM, biotech said:

I have tried setting the limit without much change:

limit controls number of posts returned. A value of zero means do not apply any limit, hence returns all available posts 🙂.

Edited by kongondo

Share this post


Link to post
Share on other sites

Hi Kongondo,

Thanks, the "blog/categories/" template makes sense when listing categories over all, my goal above was to generate something short and simple for a side bar listing - your snipped was exactly what I was after, thank you!

Share this post


Link to post
Share on other sites

Hello,

This module is great! However I have some issues with outputting the posts on the blog template. I've published a blog post and tried to output the post on the blog page with the following code:

$blog = wire('modules')->get("MarkupBlog");

// main content
$content = '';
//$content .= "<h2>{$page->get('blog_headline|title')}</h2>";
//render a limited number of summarised posts
$content .= $blog->renderPosts("limit=5", true);

This code is provided with the module so I suppose it works. However it just returns that there are no posts found. I also tried to find the posts by myself, not using the module with the following line of code:

$posts = wire('pages')->find("template=blog-post, sort=-blog_date");

But if I try to output the page ID or the title, it returns nothing. 

I double checked the post that the page is published (it is published and not hidden) so in theory I have to find the page but no matter what I do, I can't find the posts.

What am I doing wrong here or can someone point me in the right direction?

Share this post


Link to post
Share on other sites
1 hour ago, Harmen said:

This module is great!

Glad you like it.

1 hour ago, Harmen said:

What am I doing wrong here or can someone point me in the right direction?

I'm not sure what's going on. The code looks OK. Do you have debug on? Any errors? Are you able to output other pages? Did you perhaps set some access control on the posts?

By the way, is there any reason you are using wire() inside template files? i.e. $pages->find() and $modules->get() should work just fine without wire() in template files.

Share this post


Link to post
Share on other sites
44 minutes ago, kongondo said:

Do you have debug on? Any errors?

I have TracyDebugger up and running. Doesn't throw any errors.

45 minutes ago, kongondo said:

Are you able to output other pages?

Yes, I can output other pages.

45 minutes ago, kongondo said:

Did you perhaps set some access control on the posts?

The page containing the post has normal right, like every other page. Just like the parent of the post and the blog page itself.

47 minutes ago, kongondo said:

By the way, is there any reason you are using wire() inside template files?

Result of some tests I did. There is no specific reason, was just trying some things because I don't know why it isn't working

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 bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
×
×
  • Create New...