Integrating Lazydays C5 theme with a simple blog approach
Permalink 1 user found helpful
I've been trying to implement this little blog on my site that's using concrete5 and the Lazy Days theme (http://www.concrete5.org/marketplace/themes/lazy_days/):http://c5cookbook.com/recipes/make_a_blog...
However, I have been having issues getting the Blog Post page type to work. The two issues are:
1. The page type, which I've put in the Lazydays directory (concrete5/packages/theme_lazydays/themes/lazydays), cannot seem to recognize the separate Next & Previous package that I've installed in addition to Lazydays. The code follows:
<div id="nav">
$bt = BlockType::getByHandle('tony_next_previous');
$bt->controller->linkStyle = 'next_previous';
$bt->controller->nextLabel = 'Next Post';
$bt->controller->previousLabel = 'Previous Post';
$bt->controller->showArrows = 1;
$bt->controller->loopSequence = 0;
$bt->render('view');
</div>
Is there something specific I have to do in order to recognize that plugin, which is stored at /concrete5/packages/tony_next_previous ?
2. As can be seen in the instructions, their blog_type.php is based off of a very basic view.php from the default c5 themes. However, Lazyday's view.php is far more complex. Any ideas as to where I should embed the whole container <div> found in the Blog Post template explained here:
http://c5cookbook.com/recipes/make_a_blog#blog_page_type... ?
I know these questions are very specific, but any hints at all would be very much appreciated.
However, I have been having issues getting the Blog Post page type to work. The two issues are:
1. The page type, which I've put in the Lazydays directory (concrete5/packages/theme_lazydays/themes/lazydays), cannot seem to recognize the separate Next & Previous package that I've installed in addition to Lazydays. The code follows:
<div id="nav">
$bt = BlockType::getByHandle('tony_next_previous');
$bt->controller->linkStyle = 'next_previous';
$bt->controller->nextLabel = 'Next Post';
$bt->controller->previousLabel = 'Previous Post';
$bt->controller->showArrows = 1;
$bt->controller->loopSequence = 0;
$bt->render('view');
</div>
Is there something specific I have to do in order to recognize that plugin, which is stored at /concrete5/packages/tony_next_previous ?
2. As can be seen in the instructions, their blog_type.php is based off of a very basic view.php from the default c5 themes. However, Lazyday's view.php is far more complex. Any ideas as to where I should embed the whole container <div> found in the Blog Post template explained here:
http://c5cookbook.com/recipes/make_a_blog#blog_page_type... ?
I know these questions are very specific, but any hints at all would be very much appreciated.
Okay, I believe I will just not use the Lazydays theme then. Or perhaps find a way to embed a Wordpress blog into my c5 site.
Hi,
1) Packages need to be placed in your site's top-level packages directory, NOT concrete/packages. Once it's in the proper directory, you then need to go to the dashboard and install it from there (click the "Add Functionality" sidebar link, then you should see that package available for install, assuming it's in the proper directory).
2) You should start with the lazydays template, and add in the pieces you need to that (instead of starting with the blog tutorial's template and trying to add back in the lazydays stuff). I've attached a modification of the lazydays theme's default.php template which contains the necessary items -- you'll probably need to tweak it to get it looking the way you want, but it should give you a good starting point.
Note that if this is a client site you're getting paid to develop, it might be worth it to purchase one of the paid blog addons in the marketplace as they will save you a lot of development time, and give you a lot more features than this technique will.
Good luck!
-Jordan
1) Packages need to be placed in your site's top-level packages directory, NOT concrete/packages. Once it's in the proper directory, you then need to go to the dashboard and install it from there (click the "Add Functionality" sidebar link, then you should see that package available for install, assuming it's in the proper directory).
2) You should start with the lazydays template, and add in the pieces you need to that (instead of starting with the blog tutorial's template and trying to add back in the lazydays stuff). I've attached a modification of the lazydays theme's default.php template which contains the necessary items -- you'll probably need to tweak it to get it looking the way you want, but it should give you a good starting point.
Note that if this is a client site you're getting paid to develop, it might be worth it to purchase one of the paid blog addons in the marketplace as they will save you a lot of development time, and give you a lot more features than this technique will.
Good luck!
-Jordan
Here you go.
Thanks, that really helps! I just have one more question (only one thing doesn't work). The blog pages still seem to be unable to recognize the tony_next_previous package, and output this code at the bottom of each blog page:
$bt = BlockType::getByHandle('tony_next_previous');
$bt->controller->linkStyle = 'next_previous';
$bt->controller->nextLabel = 'Next Post';
$bt->controller->previousLabel = 'Previous Post';
$bt->controller->showArrows = 1;
$bt->controller->loopSequence = 0;
$bt->render('view');
Also, the text I wrote in the body don't show up! So what I'm left with is just a blog page with a title and posted date but no date content.
Since this is for a personal site/blog, I might as well give up the ghost. Is there a guide anywhere for embedding a Wordpress blog onto a c5 site?
$bt = BlockType::getByHandle('tony_next_previous');
$bt->controller->linkStyle = 'next_previous';
$bt->controller->nextLabel = 'Next Post';
$bt->controller->previousLabel = 'Previous Post';
$bt->controller->showArrows = 1;
$bt->controller->loopSequence = 0;
$bt->render('view');
Also, the text I wrote in the body don't show up! So what I'm left with is just a blog page with a title and posted date but no date content.
Since this is for a personal site/blog, I might as well give up the ghost. Is there a guide anywhere for embedding a Wordpress blog onto a c5 site?
Oops! Sorry about that -- I forgot to put php tags around that. Add this:
<?php
before that block of code, and add this:
?>
after that block of code.
<?php
before that block of code, and add this:
?>
after that block of code.
And...
I'm not sure about the text not showing up -- was this text you added before these changes were made, or after? It's possible you added them before when you had different area names. Try editing the new page now and adding some content to it, and seeing if it works. If not... well something weird is going on (feel free to post that file if you want me to take a look at it).
If you want to go the wordpress route, you don't really embed it so much as put it up next to C5 (make a new folder in your web directory called "blog", put wordpress in there). The problem is that you're going to need to convert the lazydays theme to a wordpress theme -- there's definitely a lot more documentation out there on how to do this, but it's still going to require some work. Also, you will need to log into wordpress to manage the blog, so there will be 2 logins for the site (one for wordpress for the blog, and one for C5 for the rest of the site). If you do go this route, here's the original theme that you will want to build off of to create a wordpress theme:
http://fullahead.org/index.php/work/project/lazydays/...
I'm not sure about the text not showing up -- was this text you added before these changes were made, or after? It's possible you added them before when you had different area names. Try editing the new page now and adding some content to it, and seeing if it works. If not... well something weird is going on (feel free to post that file if you want me to take a look at it).
If you want to go the wordpress route, you don't really embed it so much as put it up next to C5 (make a new folder in your web directory called "blog", put wordpress in there). The problem is that you're going to need to convert the lazydays theme to a wordpress theme -- there's definitely a lot more documentation out there on how to do this, but it's still going to require some work. Also, you will need to log into wordpress to manage the blog, so there will be 2 logins for the site (one for wordpress for the blog, and one for C5 for the rest of the site). If you do go this route, here's the original theme that you will want to build off of to create a wordpress theme:
http://fullahead.org/index.php/work/project/lazydays/...
Hooray! The minimalistic blog works now (the text I had previously entered was in the new page Description field, I didn't realize I had to create a new Content block on each new blog post and type in the stuff in there). Thank you so much for your help!
The only remaining issue is that when I create a Guestbook block in each blog post, they show up on the blog index. Is there any way to avoid that happening?
The only remaining issue is that when I create a Guestbook block in each blog post, they show up on the blog index. Is there any way to avoid that happening?
Add another area to the page (below the 'Main' area and below the tony_next_previous block), like this:
Now put the guestbook block in that area instead of 'Main', and it will not show up in the index (only blocks in 'Main' will show up in the index).
<?php $a = new Area('Comments'); $a->display($c); ?>
Now put the guestbook block in that area instead of 'Main', and it will not show up in the index (only blocks in 'Main' will show up in the index).
It's all working perfectly now. Thank you very much!