Jump to content

Blog Profile


ryan

Recommended Posts

One more question, if you don't mind: what are the benefits of defining widgets as pages/templates instead of, let's say, using some functions included in the template file?

Other than the posibility to alter the item count or the widgets' position/presence on a per page basis.

You can use the widget pages to allow the editors to define settings for each widget.

Link to comment
Share on other sites

Other than the posibility to alter the item count or the widgets' position/presence on a per page basis.

Also to alter the order they display in. One requirement I had for the blog profile is that it should be something that one could get going with and not have to touch code at all (like WordPress in that respect). So the widgets had to be defined in a manner that could be controlled in the admin rather than just the code. 

Link to comment
Share on other sites

Ryan, 

i'm setting up a blog for my wifey and mh she is always a little bit like indiana jones and explores all given functions. 

So I tried to setup a module to just provide the tree of posts and a button "Add new Post". 

I struggle a bit with the asmselect now to rebuild the new post page, so is there an easier way to achieve this, other than rebuild the whole "new page" page?

Link to comment
Share on other sites

I struggle a bit with the asmselect now to rebuild the new post page, so is there an easier way to achieve this, other than rebuild the whole "new page" page?

I'm not sure that I understand exactly what you are trying to do with asmSelect? But it is fairly straightforward to replace the "add new page" process. To do this, copy the existing /wire/modules/Process/ProcessPageAdd/* to /site/modules/ProcessPageAddLuis/. Then rename the class and filenames to ProcessPageAddLuis. Now login to your admin and install the ProcssPageAddLuis module. Then navigate in the tree to Pages > Admin > Page > Add New Page. Edit the "Add New Page" page. Change the "process" field from ProcessPageAdd to ProcessPageAddLuis. Save. Now edit your new module to work how you want it to. It should be safe through upgrades as well. 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hello everyone,

I am trying to wrap a bottom navigation bar with a div element (the MarkupPagerNav) and after some digging I realized that this was a module rather than a template. Is there a better approach to doing this than editing the 'MarkupPagerNav.module' file itself?

Thank you.

Link to comment
Share on other sites

I wonder if you can help with this error mssg I'm getting. I installed the basic blog profile on 19th March on localhost and have just gone back to it to start some serious work on it but am getting the following error:

xxxxx/tools/widgets/recent-comments/    Error Call to undefined method FieldtypeComments::findComments() (line 45 of C:\xampp\htdocs\processwireBlogTest\site\templates\blog.inc).

I checked the error log and it has been happening since the install date.

Edit: Just found that the links to the comment page /comments/ are giving a HTT P500 server error

Edit 20/04/2013: Downloaded latest version. Problem Solved

Link to comment
Share on other sites

I am trying to wrap a bottom navigation bar with a div element (the MarkupPagerNav) and after some digging I realized that this was a module rather than a template. Is there a better approach to doing this than editing the 'MarkupPagerNav.module' file itself?

See the custom options reference on this page: http://processwire.com/api/modules/markup-pager-nav/

Though if you are just trying to wrap the pagination with a div, then you could also just wrap the output that it returns to you. 

Edit 20/04/2013: Downloaded latest version. Problem Solved

The FieldtypeComments::findComments() function was added in 2.2.9. 

Link to comment
Share on other sites

Though if you are just trying to wrap the pagination with a div, then you could also just wrap the output that it returns to you. 

Almost there...had to place the opening <div> tag into 'templates\markup\posts.php' and closing into the 'main.inc'. 

...
echo $content;
?>
</div> 

However, this area gets populated with Comments and 'next-prev-posts' when single post is viewed so I can't really use it to control the positioning of the pager navigation...

As far as the API documentation I don't see how the examples are being used in the blog profile. Example #2 is the control I am after.

Thanks again.

Edited by biotech
Link to comment
Share on other sites

Almost there...had to place the opening <div> tag into 'templates\markup\posts.php' and closing into the 'main.inc'. 

Why not just put both in posts.php? I think it could be confusing to separate tags across files. 

Since you just want to wrap the pagination, I think what you want is ultimately this line in /site/templates/blog.inc, function renderPosts():

// if there are more posts than the specified limit, then output pagination
if($posts->getLimit() < $posts->getTotal()) $out .= $posts->renderPager();
change to:
// if there are more posts than the specified limit, then output pagination
if($posts->getLimit() < $posts->getTotal()) $out .= "<div id='your-div'>" . $posts->renderPager() . "</div>";
Link to comment
Share on other sites

That is what I have been trying to do but this is not possible in 'posts.php' since everything is later produced (in main.inc) by a single variable of "$content". So I could not find a way how to place opening and closing <div> tags in this file...and I agree :) don't really want to split them either.

Thanks again for the help, editing blog.inc did the trick.

Link to comment
Share on other sites

  • 2 weeks later...

I wonder if you can help with this error mssg I'm getting. I installed the basic blog profile on 19th March on localhost and have just gone back to it to start some serious work on it but am getting the following error:

xxxxx/tools/widgets/recent-comments/    Error Call to undefined method FieldtypeComments::findComments() (line 45 of C:\xampp\htdocs\processwireBlogTest\site\templates\blog.inc).

I checked the error log and it has been happening since the install date.

Edit: Just found that the links to the comment page /comments/ are giving a HTT P500 server error

Edit 20/04/2013: Downloaded latest version. Problem Solved

Re: Above post. After uploading the Exported profile to live server, this error mssg has reappeared.

Error    Call to undefined method FieldtypeComments::findComments() (line

45 of /home/website/public_html/site/templates/blog.inc).

Any ideas why this is happening.

Link to comment
Share on other sites

Error    Call to undefined method FieldtypeComments::findComments() (line

45 of /home/website/public_html/site/templates/blog.inc).

Sounds like you need a newer version of ProcessWire. I think the findComments() function was added in 2.2.9, but I'd suggest just using 2.3. 

when I upload an image in Blog Posts I get the same Image twice! named image.jpg and image-1.jpg.

What can I do?

I've not heard of that behavior before. What version of ProcessWire, and what browser/version are you using? When you upload, are you dragging-in, or using the 'Browse' button?

Link to comment
Share on other sites

I've not heard of that behavior before. What version of ProcessWire, and what browser/version are you using? When you upload, are you dragging-in, or using the 'Browse' button?

Hi ryan,

I use 2.3.0 and I figured out something more about: useing the button it works fine in Firefox and Chrome, but not in IE10 (I restartet my System to close out to be a Cache-Problem).

It´s angry, because if I make in Blog a Gallery and load i.e. 8 pictures, the page reload, all is ok, but after saving the (admin)page and reload there are 16 Pictures in the image-accordion.

And another bug with IE10, when clicking a Picture in image-accordeon there should be a lightboxeffect to see the thumb greater, but in IE10 is only a lighter gray overlay and I only come back with IE10 back-arrow.

Here in Austria we say the IE is a "hard dog", I have never seen a new Version of IE where not have been ugly Errors in dialogs or so that works fine before.

I hope you can reproduce this in your IE10.

Thanks for helping!

  • Like 1
Link to comment
Share on other sites

Here in Austria we say the IE is a "hard dog", I have never seen a new Version of IE where not have been ugly Errors in dialogs or so that works fine before.

That's the truth! 

I haven't had a chance to try things out in IE10, but will plan to do so soon. Thanks for reporting them. Anyone else able to reproduce these issues?

Link to comment
Share on other sites

  • 2 weeks later...

Regarding the search function in the blog profile. How can I extend it to pages as well as blog posts. I tried changing search.php

from

// Search the title, body fields for our query text.
    $posts = $pages->find("template=post, title|body%=$q, limit=10"); 

to

// Search the title, body fields for our query text.
    $posts = $pages->find("template=post|basic-page, title|body%=$q, limit=10"); 

but that breaks line 15 of post.php

$numComments = $page->comments->count(); 
 
Link to comment
Share on other sites

You could either add a comments field to basic-page, or add an if() check to make sure the page has a comments field before attempting to call ->count() on it. i.e.

if($page->comments) {
  $numComments = $page->comments->count();
} else {
  $numComments = 0;
}
Link to comment
Share on other sites

  • 1 month later...

Hello! I'am coming from modx revo, so i'am a newbie to pWire I started by reading a a few tutorials and I'am testing ryan's site profile.

On the blog site profile:   
site/templates/markup/post.php

	<div class='post-body'>

		<?php 
		if($small) {
			echo "<p>" . $page->summary . "… <a class='more' href='{$page->url}'>" . __('View More') . "</a></p>";
		} else {
			echo $page->body; 
			// if the post has images and no <img> tags in the body, then make it a gallery
			if(count($page->images) && strpos($page->body, '<img ') === false) include("./gallery.php"); 
		}
		?>

	</div>

Where do I change the posts list format on the homepage, so it will display a summary of the posts and display the first photo inserted on that post. I'am a bit afraid of messing up all the code.  Also on the categories pWire cms there is no summary field for the posts on the tree, and if I set the name for a twitter account I don't get any output in the frontend.

I am a newbie so I'am sorry but I'am still a bit confused about how pWire works. Thank you. 

Link to comment
Share on other sites

Hi there! If you are only testing and you don't need to build a blog right now, I would advise to stay away from the blog profile for now, as it has some rather advanced concepts. Start by reading the docs and playing around with the default install. You can also follow the existing tutorials http://wiki.processwire.com/index.php/Small_Project_Walkthrough and http://wiki.processwire.com/index.php/Basic_Website_Tutorial. You will be comfortable with PW in no time, and then you will be able to fully understand the blog profile.

  • Like 2
Link to comment
Share on other sites

Thanks Diogo! You are right it has some concepts that a newbie like me will be lost trying to grasp the meaning/dependencies of all the files on the blog profile, I will start by carefully reading the mentioned tutorials and finish my current project in Modx, then I will try pWire on my next project. I look forward to start using pWire.

Mais uma vez, muito obrigado Diogo.  

 
You might also want to check out the new Foundation site profile, which is a variation on the Basic Site Profile included with ProcessWire, but a good one to look at next to see techniques that can scale. 

Thanks Ryan I'll have look into it too.

  • Like 1
Link to comment
Share on other sites

Hi there! If you are only testing and you don't need to build a blog right now, I would advise to stay away from the blog profile for now, as it has some rather advanced concepts.

I need to check out that Foundation profile (and Zurb). You may want to revisit the Blog profile later on. A lot of generally useful techniques I had read about on the forum turn up there. Tags, Categories, Comments and nice examples of factoring out page builds (widgets etc.)

  • Like 1
Link to comment
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.
×
×
  • Create New...