Upload
jonathan-wage
View
3.814
Download
0
Embed Size (px)
DESCRIPTION
Early presentation previewing the Sympal CMS.
Citation preview
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Extension for symfony geared towards content based web applications.
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
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!
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
$ ./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
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
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Install Sympal Plugin
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
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
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
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Install Sympal Blog
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.
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
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
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
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Sympal Inline Editing• Edit content properties/columns• Edit arbitrary content slots• Select content slots type
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
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Sympal Rich Text Editing
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
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.
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
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]
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Sympal Configuration• Change configuration from sympal in
browser
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();
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) ?>
Sympal Introduction www.symfony-project.com www.sensiolabs.com
Sympal Menus• Working with menus in sympal,
are...well...simple :) and very efficient
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 -->
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) ?>
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
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.
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);
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) ?>
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'); }
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.
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