Add as a submodulegit submodule add git://github.com/kanduvisla/chunks.git extensions/chunks --recursive
This is a very basic way to put 'chunks' of content in your websites.
A what now?
A chunk: a small piece of content that is editable through the frontend. When the user is logged in, they see tiny edit-buttons at pieces of content (chunks) they can edit. A click on the edit-button will open a new window, allowing the user to only edit the specific piece of content, save and close.
But it isn't! These are the steps needed:
- Create a section for your chunks with a textarea or inputfield.
- Create a datasource with the chunks and attach them to the pages where you are going to use them.
- Include the
chunks.xsl-utility on each page where you are going to use chunks. You can find this in the
utilities-folder of the extension and copy it to the
utilities-folder of your workspace.
- Call them like so:
<xsl:apply-templates select="chunks/entry[@id=...]/content" mode="chunk" />, where
@idoffcourse is the ID of your chunk. The handle of your content-field doesn't even matter.
Please note that for HTML content you need to have the HTML Manipulation utility imported.
To have less overhead, you can filter the chunks datasource to only load the chunks needed for specific pages:
- Install the pages field extension.
- Create a chunks-section with a textarea or inputfield and a pages field
- For each chunk you create, set on which page it will be available.
- Filter the chunks-datasource on
What about images? What about multilanguage?
Well, actually, that shouldn't be too much of a problem, since the edit-window is in fact Symphonys' native
The extension only uses some CSS to hide all the fields which aren't
input, but this is ofcourse easily
adjusted to fit your needs. And as always... Feel Free To Fork (tm). ;-)
And Rich Text Editors?
Currently, only CKEditor is supported, but if you feel your favourite editor is missing, Feel Free To Fork (tm) to you too!
Requires Symphony 2.3
Added functionality to disable the edit button when the author is logged in. This might come in handy for when you're editing CSS or something like that.
Requires Symphony 2.3