35
Sympal Introduction www.symfony-project.com www.sensiolabs.com Extension for symfony geared towards content based web applications.

Sympal - Symfony CMS Preview

Embed Size (px)

DESCRIPTION

Early presentation previewing the Sympal CMS.

Citation preview

Page 1: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Extension for symfony geared towards content based web applications.

Page 2: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

The Idea• Sympal was born out of years of building

content based web applications using various frameworks and tools in different languages.

• The name was born from wanting the functionality Drupal provides but in a good way, like in symfony

(Drupal - bad code) + symfony = Sympal

Page 3: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Multiple Plugins• Core Plugins

• sfSympalPlugin• sfSympalMenuPlugin• sfSympalPluginManagerPlugin• sfSympalUserPlugin• sfSympalPagesPlugin• sfFormExtraPlugin• sfTaskExtraPlugin

• Addon Plugins• sfSympalBlogPlugin• sfSympalCommentsPlugin• ...More coming soon. Develop a new sympal addon!

Page 4: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

What does it add?• Extra tasks• Extra functions in your base sfActions• Better integrated support for e-mail sending• Easy interactive installation• Addon plugins that can be one click installed• Menus/sitemap, admin bar, editor menu, etc.• Custom content types• Custom content slot types• Lots more tools

Page 5: Sympal - Symfony CMS Preview

$ ./symfony list sympal

Available tasks for the "sympal" namespace: :install Install the sympal plugin content management framework. :plugin-download Download a sympal plugin to an existing sympal installation :plugin-generate Generate the skeleton for a sympal plugin :plugin-install Install a sympal plugin to an existing sympal installation :plugin-uninstall Uninstall a sympal plugin to an existing sympal installation

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Additional Tasks

Page 6: Sympal - Symfony CMS Preview

sfSympalEventPlugin config/ doctrine/ schema.yml routing.yml sfSympalEventPluginConfiguration.class.php data/ fixtures/ install.yml lib/

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Generate Sympal Plugin

$ ./symfony sympal:plugin-generate Event --content-type=Event This command will create a new plugin named sfSympalEventPlugin Are you sure you want to proceed? (y/N)

Generate a new Sympal plugin from the command line

Page 7: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Install Sympal Plugin

Page 8: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Default Sympal Plugin Install• Adds new menu item• Adds new content type• Adds sample content record

Page 9: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Download Sympal Plugin• You can download and install new sympal

plugins from the web interface or from the command line

Page 10: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Install Sympal Blog• One click install a blog• Downloads from svn or pear and runs

installation

Page 11: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Install Sympal Blog

Page 12: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Add Sympal Comments to Blog• The sfSympalBlogPlugin was built to work

with sfSympalCommentsPlugin so all we need to do is install it to add comments to our blog.

Page 13: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Events• Events are implemented in Sympal so you can

easily custom admin menus, the editor toolbar, etc.– sympal.load_admin_bar– sympal.load_settings– sympal.load_tools

Page 14: Sympal - Symfony CMS Preview

class sfSympalSamplePluginConfiguration extends sfPluginConfiguration{ public static $dependencies = array( 'sfSympalPlugin' );

public function initialize() { $this->dispatcher->connect('sympal.load_admin_bar', array($this, 'loadAdminBar')); }

public function loadAdminBar(sfEvent $event) { $menu = $event['menu'];

$administration = $menu->getChild('Administration'); $administration->addChild('New Item', '@new_item_route'); }}

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal EventsHook in to the sympal events so you can customize and add things for your needs

Page 15: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Inline Editing• Edit content inline

<h2><?php echo get_sympal_column_content_slot($content, 'title') ?></h2>

<?php echo get_sympal_column_content_slot($content, 'date_published') ?>

Posted by <?php echo get_sympal_column_content_slot($content, 'created_by', 'render_blog_post_author') ?> on

Page 16: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Inline Editing• Edit content properties/columns• Edit arbitrary content slots• Select content slots type

Page 17: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Rich Text Editing• Easily upload photos to your content• Create rich content with the YUI Rich Text

editor

Page 18: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Rich Text Editing

Page 19: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Content Form• If you don’t want to edit content inline you

can always edit from a backend form

Page 20: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Content Types• Sympal core only provides one content type

and it is a basic CMS page with a title and a body

• You can easily add new content types to sympal for your project. i.e. Article, Event, etc.

Page 21: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Content Slot Types• Sympal providers four different built in

content types.– Text - Single one line input text box– MultiLineText - Multi line input text box– RichText - YUI rich text editor– Markdown - Same as MultiLineText but rendered

with Markdown

Page 22: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Configuration• Everything in sympal is configurable via web

interface or yaml.

all: sympal_settings: recaptcha_public_key: 6Ld2DgQAAAAAAApXLteupHPcbSxbSHkhNTuYLChX recaptcha_private_key: 6Ld2DgQAAAAAANIbaXJsFEBOyg56CL_ljy3APlPb language_codes: [en, fr, es] disallow_php_in_content: false default_layout: sympal rows_per_page: 10 I18n: enabled: true ContentSlot: true MenuItem: true sympal_plugin_svn_sources: ["http://svn.symfony-project.com/plugins"] markdown_styled_boxes: [quote, tip, caution, note]

Page 23: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Configuration• Change configuration from sympal in

browser

Page 24: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Sites• With sympal you can easily manage multiple

sites from one installation.• A sympal site is bound to a symfony

application

require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

$configuration = ProjectConfiguration::getApplicationConfiguration('sympal', 'prod', false);sfContext::createInstance($configuration)->dispatch();

Page 25: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Breadcrumbs• Since sympal manages your sitemap we can

easily generate breadcrumbs from your current position.

• Of course if you want to generate breadcrumbs manually you can do so

<?php echo get_sympal_breadcrumbs(array( 'Home' => '@homepage', 'About' => '@about', 'Jonathan H. Wage' => null)) ?>

<?php echo get_sympal_breadcrumbs($menuItem) ?>

Page 26: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Menus• Working with menus in sympal,

are...well...simple :) and very efficient

Page 27: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Menus• Menus only ever require one query no matter

how many menus you have and how many times you call/render them in one page </p> <?php echo get_sympal_menu('footer') ?> </div> <!-- end footer -->

Page 28: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Sub-menus• You can easily retrieve a sub menu for a

menu item by simply passing it to the get_sympal_menu() method.

• In this example we get the sub menu for the current menu item.

<?php $subMenu = get_sympal_menu($currentMenuItem) ?>

Page 29: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Routing• Multiple urls for content• Specify one url as primary• Change urls without affecting seo and

creating 404s• Custom urls for individual content or content

types

Page 30: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Security• Sympal implements your basic security model

using users, groups and permissions.• All content and menus can be restricted for

certain users, groups, permissions, etc.• Menus can require auth, no auth, etc.

Page 31: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal E-Mail• You can easily send and manage your

application e-mails with sympal.

• First argument can be path to partial or component

• Second argument is array of variables for e-mail

$variables = array( 'forgot_password' => $forgotPassword, 'email_address' => $this->form->user->email_address, 'user' => $this->form->user);$this->sendEmail('sympal_forgot_password/send_request', $variables);

Page 32: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal E-Mail• In a sympal e-mail template the subject is

the first line and body is everything else.

• This is so the subject and body of your e-mails are managed in one place.

Forgot Password Request for <?php echo $user->getUsername() ?>

Hello <?php echo $user->getName() ?>,<br/><br/>

This e-mail is being sent because you requested information on how to reset your password.<br/><br/>

You can change your password by clicking the below link which is only valid for 24 hours:<br/><br/>

<?php echo link_to('Click to change password', '@sympal_forgot_password_change?unique_key='.$forgot_password->unique_key) ?>

Page 33: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

Sympal Action Confirmations• Often you want to confirm an action in

symfony. A delete, or some intense operation. Usually this is only possible client side. Until now!

• Clicking yes will re-send action withconfirmation and continue execution.

public function executeDelete(sfWebRequest $request) { $this->askConfirmation('Please Confirm', 'Are you sure you wish to delete this record?');

$user = $this->getRoute()->getObject(); $user->delete();

$this->getUser()->setFlash('notice', 'User was deleted successfully!'); $this->redirect('@homepage'); }

Page 34: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

New Menu Manager

Makes use of YUI tree and menus to manage your menus. Current system is un-finished and uses jQuery.

Page 35: Sympal - Symfony CMS Preview

Sympal Introduction www.symfony-project.com www.sensiolabs.com

More to come• More YUI in the interface• General cleanup and enhancing of interface• Add more Sympal addon plugins• Fix bugs• Create documentation