Coder Social home page Coder Social logo

fr0z3nfyr / cakephp-simplecontent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stefanvangastel/cakephp-simplecontent

0.0 1.0 0.0 1.98 MB

This CakePHP plugin makes it possible to simply add, edit and delete content pages. For example, if you created a webshop CakePHP app and need some semi-static pages (the admin can edit) like a terms or contact page, this plugin makes that kind of simple easy editable pages possible without the need of a full CMS.

PHP 32.81% ASP 3.69% ColdFusion 5.12% Java 16.88% Lasso 0.38% Perl 1.11% Python 1.14% HTML 16.66% JavaScript 18.91% CSS 3.29%

cakephp-simplecontent's Introduction

SimpleContent


Intro

This CakePHP plugin makes it possible to simply add, edit and delete content pages. For example, if you created a webshop CakePHP app and need some semi-static pages (the admin can edit) like a terms or contact page, this plugin makes that kind of simple easy editable pages possible without the need of a full CMS.

Requirements

This plugin requires jQuery to be loaded. It uses CKEditor 4 and the editablediv technique for editing pages.

Installation and Setup

(1) Check out a copy of the SimpleContent CakePHP plugin from the repository using Git :

git clone http://github.com/stefanvangastel/CakePHP-SimpleContent.git

or download the archive from Github : https://github.com/stefanvangastel/CakePHP-SimpleContent/archive/master.zip

You must place the SimpleContent CakePHP plugin within your CakePHP 2.x app/Plugin directory.

(2) Load the plugin in app/Config/bootstrap.php

// Load SimpleContent plugin, with loading routes for short urls CakePlugin::load('SimpleContent', array('routes' => true));

(3) Load the database structure SQL file to create the required table in your database or use the cake schema shell.

user@host$ cake schema create --plugin SimpleContent

or load the SQL struct file in your db from location: app/Plugin/SimpleContent/db/simplecontent_table_structure.sql

(4) Optional configuration

(4.1) Filemanager plugin for CKeditor

To enable the filemanager plugin, copy or symlink the /SimpleContent/webroot/filemanager/ directory to /app/webroot/filemanager (CakePHP won't allow usage of PHP files from the plugin/webroot dir's)

Configure filemanager (eg. for Auth in filemanager/connectors/php/filemanager.config.php)

(4.2) Change the layout for the display and edit functions of the plugin.

You can do this in /SimpleContent/Controller/SimpleContentAppController.php

(4.3) Change the Auth settings for the edit and create functions of the plugin.

You can do this in /SimpleContent/Controller/SimpleContentAppController.php

(5) Visit http://YOUR_URL/sc/

Tips

If you want to include the content of a certain page, you can use this in the view of that page:

<?php
$page = $this->requestAction('/sp/10/Slugged_page_title'); //10 is the id of the page, that is all that matters. The slugged title is nice for Google

if( ! empty($page['SimplePage']['content']) ){
	
	//Title
	echo '<h1>'.$page['SimplePage']['title'].'</h1>';
	
	//Content
	echo $page['SimplePage']['content']; 
}
?>

This way you can use the content of pages created by SimpleContent whereever you want.

cakephp-simplecontent's People

Contributors

stefanvangastel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.