Package: simplelayout.base
Introduction============SimpleLayout provides an intuitive way of adding and arranging the differentelements of a page such as paragraphs, images, files and links usingdrag-and-drop functionality.These elements are implemented as addable and easily arrangeable "blocks".Because of the restricted dimensions of text, images and other content elements,the general result is content with a uniform look and feel throughout the site... WARNING::``simplelayout.base >= 4.0`` does no longer include and install the oldsimplelayout types. If you still use them, also install`simplelayout.types.common`_.But we encourage you the newer implementation in `ftw.contentpage`_!Installing simplelayout=======================**New ftw.contentpage implementation**The package ``simplelayout.base`` nowadays does no longer contain the contenttype implementation. We encourage you to install `ftw.contentpage`_, whichbases on ``simlelayout.base`` and provides a simplelayout content page typeand the necessary block types.Please follow the installation instructions in the`readme of ftw.contentpage <https://github.com/4teamwork/ftw.contentpage#installing>`_.**Old simplelayout types**If you, however, want to install the old simplelayout types, you may want toinstall `simplelayout.types.common`_.You need to install both, ``simplelayout.base`` and ``simplelayout.types.common``::[buildout]...[instance]eggs +=simplelayout.basesimplelayout.types.commonAnd install ``simplelayout.base`` and ``simplelayout.types.common`` genericsetup profiles.How to use SimpleLayout=======================Check out our video section on plone.org:http://plone.org/products/simplelayout.base/documentation1.) Add a new Page from the "Add new" dropdown.In this page one can now add the following page elements:- File- Image- Link- Page- Paragraph2.) Add a new Paragraph from the "Add new" dropdown:- Provide a title for the new paragraph (not required) and check "Show Title"to determine whether the paragraph title will appear in the page's body text.- Provide body text for the paragraph.(Of course one could use this firstparagraph to provide the text for the whole page, but that would defeat thepurpose of having easily arrangeable "blocks" of text and other page elements)Image tab:- Browse for an image and provide a caption and alternative text.- Determine whether the image is "clickable", i.e. whether the image source canbe opened in a new tab. If collective.greybox is installed, it will usegreybox to show the image.Settings tab:- Provide keywords/tags for categorization purposes.- Specify "Related Items": If the "teaser" box is checked, related items of thisparagraph will be displayed underneath the paragraph.- Provide "Creators" (Persons responsible for creating the content of this item).- Allow comments.- Determine whether this paragraph should be included in the site navigation(by default it is not included).When saving the paragraph, one is redirected to the edit tab of the parent page.Here one is presented with the option of editing the page as a whole, or editingone of the sub-elements of the page.The layout of the recently added paragraph can be further manipulated using thelayout icons in the top panel of the that paragraph.The paragraph can also easily be deleted from here, or its order in the pagechanged using the "ordering" arrow icons in its top panel (will be removed,you should use the drag'n'drop funtionality).3.) Add an Image to the page from the "Add new" dropdown:- Browse for an image and provide alternative text. The Title is used as theimage caption.4.) Add a File to the page from the "Add new" dropdown:- Browse for and add a file (for example a pdf). The file download link will bedisplayed in the page content.5.) Add a Link to the page from the "Add new" dropdown:- Specify an external link, which will be displayed in the page.6.) Add another page:The parent page acts as a container in which sub pages can be added.These will appear in the site navigation.Page Layout:------------To add layout functionality to the page as a whole, go to"Site Setup" => "Simplelayout Configuration", and check "Show Design".A "Design" dropdown will be added to your SimpleLayout pages, from which you canchoose one of 3 possible layouts: Normal, Two Columns, Two Columns One on TopHere one can also determine the dimensions of the layout columns by providing pixelvalues in the other 2 "configuration" tabs.Go to the edit tab of your SimpleLayout page and choose another layout from the"Design" dropdown.In "Two Columns" designs it's possible to align the blocks like a table.Use the "align to grid" link in the top panel of the page.Drag and drop functionality:----------------------------Drag the existing content blocks into the other areas of the newly created layout,by clicking on the top panel and dragging the block to the desired position.Support of following products is allready included--------------------------------------------------* collective.greybox* Products.PloneFlashUploadtested with http://svn.plone.org/svn/collective/PloneFlashUpload/branches/dunny-flash-10-support-via-swfupload-2.2Simplelayout provides the following features:=============================================simplelayout.base-----------------* Base functions* Base layout rendering* Base block actions* Base viewlets- one column- two columns- two columns with one column on top- controls* configlet- simplelayout is completely configurable TTW, including image sizes and column dimensions* design menu- choose between the different designs/layouts* includes block configuration adapters- all block configs such as layout, image sizes, block height etc, will be saved in an adapter (annotations) for every block* upgrade steps* base JS functions- align to grid (for two columns designs only)- helper functions* New scales for atct image field (requires zope restart)For more information check simplelayout dependencies:* simplelayout.ui.base* simplelayout.types.common* simplelayout.ui.dragndropFAQ===This FAQ provides some technical information/answers.:Q: After reinstall I lose my configlet configuration?:A: Do not reinstall simplelayout.base using QI, but rather use portal_setup import steps.Because the configlet data is stored in a local utility, in the event of areinstallation the utility will be removed (all data is gone) and addedagain with default values. The following example shows how to changethe sl configlet default values with setuphandlers in a policy package.imports::from zope.component import getUtilityfrom simplelayout.base.configlet.interfaces import ISimplelayoutConfigurationconfig.py::SL_CONFIGURATION = {'show_design_tab' : True,'small_size' : 145,'middle_size' : 302,'full_size' : 614,'small_size_two' : 66,'middle_size_two' : 145,'full_size_two' : 300}method in setuphandlers.py::def simplelayoutConf(self):sl_conf = getUtility(ISimplelayoutConfiguration, name='sl-config')for key in SL_CONFIGURATION:setattr(sl_conf,key,SL_CONFIGURATION[key]):Q: How does simplelayout know which content type is a block?:A: Simplelayout marks blockable types with the interface *ISimpleLayoutBlock*:Q: Can I use simplelayout listings on other content types?:A: Of course, just make sure your type provides the ISimpleLayoutCapableinterface and paste the following code into your template ::<tal:block content="structure provider:simplelayout.base.listing" />Make simplelayout blocks addable on your type.:Q: Can I uninstall simplelayout.base?:A: As many new packages based on component architecture, not yet...:Q: How can I add a new image scale?:A: ...:Q: How can i remove them?:A: Navigate to portla_types/blocktype in the ZMI, select "actions" andremove the image scale from actions list.:Q: I have a content type which I want to use it as block in simplelayout?:A: Just register a BrowserView named block_view for the specific content type,then z3c knows what to do. Example in simplelayout.types.common:configure.zcml::<browser:pagefor="Products.ATContentTypes.interface.file.IATFile"name="block_view"template="file.pt"class=".views.FileView"permission="zope2.View" />:Q: I would like to create my own design template?:A: ...:Q: Is there a possibility for blocks to show up as a portlet?:A: This feature is under development and will be released soon.:Q: How do you know in multible column designs, where to show up the blocks?:A: Blocks has two additional interfaces: a slot interface and a columninterface. The slot interface tells the block where he should appear.The column interface desides the image scale.:Q: My images will be resized by CSS?:A: Tick the box "Set simplelayout scales as image scales", restart zope an "recalc images".Don't use atct_tool for this action, because it will ignore paragraphs.:Q: Is it possible to use more than one block_view per type?:A: Yes, in the 2.0 release of simplelayout.base its possible to define your own viewfor a blockable type, you have to customize the actions and the action-icons of yourcontent type. the action id should look like the following exampleid: sl-dummyscale-dummycssklass-myviewsl- = simplelayout prefix for actionsdummyscale = the image scale, possible values are small, half or fulldummycssklass = an additional css wrapper classmyview = your view must be registered as block_view-myviewIf yout don't need a scale or additional css class, please fill in somedummy values as in the example above, Otherwise your view will have thewrong name.TODO====* TESTS* mess up JS* fix block height, if moving blocks from two to one column.* send feedback if ajax request failsInstallation============- Add ``simplelayout.base`` to your buildout configuration:::[instance]eggs +=simplelayout.base- Install the generic import profile.Uninstall---------This package provides an uninstall Generic Setup profile, however, it willnot uninstall the package dependencies.Make sure to uninstall the dependencies if you no longer use them.Links=====- Github: https://github.com/4teamwork/simplelayout.base- Issues: https://github.com/4teamwork/simplelayout.base/issues- Pypi: http://pypi.python.org/pypi/simplelayout.base- Continuous integration: https://jenkins.4teamwork.ch/search?q=simplelayout.baseCopyright=========This package is copyright by `4teamwork <http://www.4teamwork.ch/>`_.``simplelayout.base`` is licensed under GNU General Public License, version 2... _ftw.contentpage: https://github.com/4teamwork/ftw.contentpage.. _simplelayout.types.common: https://github.com/4teamwork/simplelayout.types.commonChangelog=========4.0.6 (2016-02-18)------------------- Align blocks to grid after images are fully loaded. use window.onload for this purpose.[mathias.leimgruber]4.0.5 (2015-03-16)------------------- Set image block width to full width.[Kevin Bieri]4.0.4 (2015-02-23)------------------- Fix a bug which prevent the "align to grid" feature on page load.[mbaechtold]4.0.3 (2014-07-09)------------------- Ensure backwards compatibility with multiview feature.[tschanzt]4.0.2 (2014-07-08)------------------- Specify version in setup.py[tschanzt]4.0.1 (2014-06-13)------------------- Nothing changed yet.4.0.0 (2014-06-11)------------------- Add an "uninstall" profile.[jone]- Drop simplelayout.types.common dependency.If you still use simplelayout.types.common pages, youneed to verify that you still install it when upgrading![jone]3.0.4 (2013-12-13)------------------- Update english translations[mathias.leimgruber]- Update german translations[mathias.leimgruber]- Remove old i18n directory and translate everything from scratch.[mathias.leimgruber]3.0.3 (2013-10-16)------------------- Add Permission to align to grid action.[tschanzt]- Fix dragndrop for two column layout.[tschanzt]- Make layoutchanges possible on second view.[tschanzt]- The sizes in simplelayout controls should not be affected by font-size.[Julian Infanger]- Fixed problem on draging blocks in simplelayout two column layout.[Julian Infanger]3.0.2 (2013-05-31)------------------- Use percentual padding for 2 column layout.[tschanzt]- Fix tests - Fill text field with html.Otherwise plone guesses the mimetyp wrong (text/plain).[mathias.leimgruber]3.0.1 (2013-04-16)------------------- No longer restrict setting set_initial_layout on objects insidea ISimplelayoutCapable container.[mathias.leimgruber]- Remove everything related to workflow manipulationfrom simplaylout[mathias.leimgruber]3.0 (2013-03-29)----------------- Added flowplayer icon to sl control sprites.[Julian Infanger]- Fix permission of simplelayout.base.actions.align.[mathias.leimgruber]- Add simplelayout capable behavior for sl dexterity containers.[jone]- Simplelayout should not change the styling of default plone classes.[Julian Infanger]- Fix controls condition for all actions (layout + content actions).[mathias.leimgruber]- Only set a min-height on empty slots if you are dragging a block.[Julian Infanger]- Removed all important statements from css.[Julian Infanger]- Fix css selector for empty dropzoneportlet.[mathias.leimgruber]- Replace jq with $.[mathias.leimgruber]- Add control styles for dropzone portlet.[mathias.leimgruber]- Use same viewlet name for all three diffrent listing viewlets.[mathias.leimgruber]- Do not reset block layout when copying / moving the container.[jone]- Fixed bug in function to get factory menu; return menu instead of True.[Julian Infanger]3.0c3 (2013-01-24)------------------- Add show_description function.[ttschanz]- Fix templates.[mathias.leimgruber]- Fix CSS for emptymarker klass.[mathias.leimgruber]3.0c2 (2013-01-21)------------------- Use more effective CSS statements, prefixed with #content so that it allowsa general styling of elements such as lists.[jone]- Register interfaces so that they can be toggled in manage_interfaces.[jone]- Enable/Disable factory menu on folderish blocks.[mathias.leimgruber]- Implement emptymarker css klass.[mathias.leimgruber]- Fix condition, which checks if there is a valid image inImageScaler.[mathias.leimgruber]- No longer change writing direction in block wrapper as this causes problemswith IE7.[buchi]- Implemented interface cleanup while moving a block.[phgross]- Fix CSS for factory menu.[mathias.leimgruber]- Fix sl-control toggler css.[mathias.leimgruber]- Add tests for page and paragraph creation.[mathias.leimgruber]- Add new slot (slotD) Interface.[mathias.leimgruber]- Updated default CSS for simplelayout actions.[Julian Infanger]- Move package to github and clean it up.[jone]- Fix wrong initial metadata according to latest upgrade.[jone]- Remove bad import step dependency "metadata" (does not exist).[jone]3.0c1 (2012-07-30)------------------- Fix indexing blocks in container, so that it does notbreak the catalog when deleting recursively.[jone]- Handle ComponentLookupError when plone site is deleted.[jone]- Wrap div around below-content-body viewlets, like in Plone4 templates.[Julian Infanger]3.0b10 (2012-06-28)-------------------- Removed multiple used id in simplelayout actions viewlet.[Julian Infanger]- Dont change list-style-position to inside. Causes problem with list styling.[Julian Infanger]3.0b9 (2012-06-18)------------------- Do not add SearchableText if content is a file.[Julian Infanger]3.0b8 (2012-06-11)------------------- Added upgradestep: Don't show Paragraph in search.[Julian Infanger]- Fixed indexer and eventhandlers: have to work for ISimpleLayoutCapable.[Julian Infanger]3.0b7 (2012-06-08)------------------- Created indexer which adds the block SearchableText to the pagesSearchableText. Also added eventhandlers to make sure the index isup-to-date.[Julian Infanger]3.0b6 (2012-05-09)------------------- Fixed CSS problem with floated image and list in block.[Julian Infanger]3.0b5 (2012-04-25)------------------- Show design tab for roles, which can be specified in the simplelayout configlet.[Julian Infanger]- Added tooltips to simplelayout actions.[Julian Infanger]- Fixed CSS problem with floated image and list in block.[Julian Infanger]3.0b4 (2012-04-23)------------------- Do not show simplelayout controls viewlet if there are no controls.[Julian Infanger]3.0b3 (2012-04-05)------------------- Fix setBlockHeights function.[mathias.leimgruber]3.0b2 (2012-04-02)------------------- Added upgrade step[elio.schmutz]3.0b1 (2012-03-05)------------------- Add upgrade step for creating initial paragraph versions (paragraphs are now versioned).[jone]- Implement new way of editing a block (edit actions will appear at mousover).[24.01.2012, mathias.leimgruber]- Fix right margin for small and middle images on the left site[20.12.2011, elio.schmutz]- Plone 4.1 compatibility: Use _ instead of - as ID sepereator.[03.08.2011, jbaumann]- Fix permission check for sl-actions and sl-layouts[27.05.2011, mathias.leimgruber]- Added some CSS for new Image display behavior.[05.05.2011, mathias.leimgruber]- Fix IE 7 stupid behaviour with floating elements.[03.02.2011, mathias.leimgruber]- Fix sl actions view, also check action condition.[04.01.2011, mathias.leimgruber]- fix align blocks to grid function (remove buggy px_to_em plugin)[27.12.2010, mathias.leimgruber]- fix workflow menus css[13.07.2010, mathias.leimgruber]- fix controls css[13.07.2010, mathias.leimgruber]- Clean up views.py / remove tabs in configure.zcml[13.10.2010, mathias.leimgruber]- Fixed a bug while rendering the sl-actions (check for visible attr)[13.10.2010, mathias.leimgruber]- Removed old Products.FlashUpload support, it's not longer necessary.[04.10.2010, mathias.leimgruber]- implemented image scaling by plone.app.imaging. Manual recalc button inconfiglet is not longer necessary.[30.09.2010, mathias.leimgruber]- added workaround for blob image field[29.09.2010, mathias.leimgruber]- removed actioniscons.xml and added icon_expr directly to thecontent types xml. Because the actionicons tool in plone 4 has been deprecated[12.07.2010, mathias.leimgruber]- rewrite browserviews with allowed_attributes[12.07.2010, mathias.leimgruber]2.1.2------ fix alignblocktogrid function if there is only an image[mathias.leimgruber]2.1.1---------------- bugfix: ObjectEditedEvent, the viewname property was missed[mathias.leimgruber]2.1---------------- change dependency for simplelayout.ui.* to <=2.1[mathias.leimgruber]2.0---------------- use the action ids on blockable types to define a custom blockviewname, the custom viewname is stored in anotations.check FAQ section in README file for an example.[mathias.leimgruber]- use absolute path for control icons [mathias.leimgruber]2.0rc6---------------- removed special characters that prevented buildout torun [florian.sprenger]2.0rc5---------------- fix recalculating all images function, check if IBlockConfig isaddaptable [mathias.leimgruber]- fire "set init. layout" on IObjectEditedEvent [mathias.leimgruber]- use a cookie to store the edit-mode state [mathias.leimgruber]- remove unused code [mathias.leimgruber]- moved JS toggleEditMode function tosimplelayout.ui.base [mathias.leimgruber]- Upgrade step from 2.0rc4 to 2.0rc5 [mathias.leimgruber]- reorder JS by GenericSetup [mathias.leimgruber]2.0rc4---------------- mark right and left column by a css class [mathias.leimgruber]2.0rc3----------------- don't display the empty sl-control panel <div />for anonymous users  [mathias.leimgruber]2.0rc2----------------- fix event: change all block states from page [mathias.leimgruber]- added simplelayout page to default_page_types [mathias.leimgruber]- load sl-JS only if we are on a simplayout capable object and if useris logged in. [mathias.leimgruber]- simplelayout view provides a function to determin if current object issimplelayout capable or not. [mathias.leimgruber]- compress, merged and cache js. [mathias.leimgruber]2.0.rc1----------------- remove obsolete code [mathias.leimgruber]- added permission check befor rendering sl-actions [mathias.leimgruber]- Change required permission to "View" from controls viewlets [mathias.leimgruber]- updated readme2.0b3----------------- Issue #1: fix some Translations [julian.infanger]- Add the possobility to set simplelayout image sizes as atct image scalesNow there's no quality issue with IE anymore. [mathias.leimgruber]2.0b2----------------- added technical FAQ to README [mathias.leimgruber]- added HowTo to README [arno.blumer]- fix error while reinstalling [mathias.leimgruber]- added more info to README/HISTORY [mathias.leimgruber]- some IE7 JS fixes [mathias.leimgruber]2.0b1----------------- create two columns layout [mathias.leimgruber]- fixed dragndrop functionality for two columns [mathias.leimgruber]- align two columns layout to grid [mathias.leimgruber]- works great in FF 2.x - 3.x- There are some display issues in edit-mode with IE 6/7- edit-mode for safari and IE 8 not tested- added a tow column view with a one column slot on top [mathias.leimgruber]- added design menu [mathias.leimgruber]- some fixes in sl-controls ajax reload [victor.baumann]- reload block after moving arround [mathias.leimgruber]1.0----------------- Initial release- Extracted from plonegov.website 1.0 [mathias.leimgruber]- Shipps base function for simplelayout [victore.baumann]- simplelayout configlet included [mathias.leimgruber]- based on:- simplelayout.types.common- simplelayout.ui.base- simplelayout.ui.dragndrop