Jump to content

CMS for Website!

Guest

So, I have a website and want to add a CMS to it so i can edit the pages easily without having to login into my cpanel, is it possible to make one unlike wordpress or others where i can login and edit files on the ftp. as i have custom wrote my site i dont want to have to write posts and crap like other CMS's and want to make my own as a challenge, and tutorials on how to do so or guides would be much appreciated!

Link to comment
Share on other sites

Link to post
Share on other sites

I use Concrete5. You can convert an HTML or PHP based site into a Concrete5 template in about an hour and once you're done it's super easy to modify.

 

This 22 minute video explains the whole process: 

 

 

but it basically boils down to this:

 

You add one line to the top of your pages:

 <?php Loader::element('header_required')?>

one to the footer:

<?php Loader::element('footer_required')?>

All of your src tags like src=js/bootstrap.js need to be apended with 

<?php echo $view->getThemePath()?>

Becoming

src="<?php echo $view->getThemePath()?>/js/bootstrap.js"

^ easily done with find & replace.

 

Anywhere you want content to be editable you need 4 lines of PHP (you delete the content and replace it):

<?php    $a = new Area('Area Name');    $a->display($c);?>

So...

<div class="about section nobackground">    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer euismod lacus id augue eleifend, a rhoncus arcu sagittis. Nullam massa purus, porta non aliquet eu, condimentum nec felis. Donec gravida mi sit amet lorem vehicula, id dignissim felis tincidunt. Integer rutrum id purus in volutpat. Donec semper ultricies rutrum. Etiam sed placerat lorem. Vivamus eleifend ipsum eu arcu laoreet, feugiat sollicitudin justo posuere. Etiam eu diam ante. Sed eget quam purus. Nunc pharetra gravida neque, et consequat diam molestie eu. Mauris sed cursus turpis. Sed convallis, felis aliquam consectetur consectetur, nunc dui dapibus nibh, tristique finibus felis massa eget turpis. Nunc eget pharetra nulla. Pellentesque pulvinar lacus ac felis auctor semper. Nam ornare varius vestibulum. Nunc malesuada enim eu porta bibendum.</p><div>

becomes:

<div class="about section nobackground">    <?php        $a = new Area('About Content');        $a->display($c);    ?><div>

and you're done. You can have whatever you want as dynamic content and whatever you want as static content in the code.

 

You can do more and use their auto generated menu system so you can add pages on the fly (it dumps a standard unordered list menu that you can skin as you like,) you can create custom blocks, there are manifest files you can use to import js from the core, you can split out the header and footer into /elements/header.php and /elements/footer.php and call them on your pages instead of duplicating them... It's up to you... It's all optional. It's as easy or as complex and you need/want. 

 

The menu works like this on one of my sites:

 

from header.php:

   <?php        $nav = BlockType::getByHandle('autonav');        $nav->controller->orderBy = 'display_asc';        $nav->controller->displayPages = 'top';        $nav->controller->displaySubPages = 'none';        $nav->render('templates/kickass_nav');    ?>

I copied their auto nav template to /application/blocks/autonav/templates/kickass_nav.php and made the changes I needed.

Link to comment
Share on other sites

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

×