10375 Posts in 2190 Topics by 1707 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1648 Views |
-
Blocks :: Using ModelAdmin to manage global contentblocks

18 September 2009 at 10:12pm Last edited: 18 September 2009 10:18pm
Hi all,
Im experimenting with a module to add extendable contentblocks which are global accessible on different template positions on the website. ( Like Joomla does with modulespositions and SS does with widgets, but with a central admin section in the CMS)
I'm curious about your opion about my approach:
Use ModelAdmin to administer blocks, templatepositions and css classes (css needs some rethinging).
A Block class which is extendable to add functions like a searchblock, menublock, loginblock.
Each Block can be set to display on page selection or all pages (loggedin/loggedout?) (Not yet implemented)I made a working example, but needs some adjustments.
Current usage:
Install the block module.
In the cms (MainMenu blocks) add your cssclasses and template positions and add some general contentblocks( with template position and css class)In Page_Controller add:
function Blocks($pos = 'header') {
return DataObject::get("Block", "Active = 1 AND Position = '".$pos."'");
}In your theme Page.ss add your desired blockpositions like:
<% control Blocks(header) %>
<% include Blocks %>
<% end_control %>where header is a theme positions like footer, left, right etc.
I added a zip with a sample blockmanager and some extended Block classes for a MainMenuBlock and SearchBlock.
Some TODO's:
Using RenderWith instead of a switch in Blocks.ss (requires new controls when extending the blocks).
Adding a Tab for selecting pages where to display the Block.What do you think?
Edit::
For making TinyMCE to work in ModelAdmin I needed this patch:http://open.silverstripe.com/attachment/ticket/3586/ModelAdmin.js
-
Re: Blocks :: Using ModelAdmin to manage global contentblocks

14 January 2010 at 4:49am
Very interesting for me.
Will you continue to develop it? -
Re: Blocks :: Using ModelAdmin to manage global contentblocks

27 January 2010 at 2:30am
Can you briefly explain how to install sample blockmanager?
-
Re: Blocks :: Using ModelAdmin to manage global contentblocks

20 April 2010 at 6:36pm Last edited: 20 April 2010 6:36pm
This looks like exactly what I need but I'm completely unfamiliar with this level of CMSMS development so could do with some help Embarrassed.Basically, I have a sidebar that contains, in the top half, the news summary from the news module. Below that, I want the website editors to be able to edit what appears in the lower half of the sidebar.I tried adding a content block ({content block="Sidebar"}) to that section of the sidebar. When I went to braindumps oracle
edit one of the pages, I had a 'Sidebar' text area and that worked fine. However what I wanted was for that content block to then be repeated on all the pages that use the sidebar, without manually going through them all.Which is what brought me here.
-
Re: Blocks :: Using ModelAdmin to manage global contentblocks

21 April 2010 at 1:40am
I use ManyManyDOM to manage callouts on every page, and the nice thing is they're extendible, and since 2.4, you can drag-and-drop sort them uniquely on any page, and it's all in CMSMain, so you can be looking at a given page and see its associated callouts.
Would that be code you guys would be interested in seeing?
-
Re: Blocks :: Using ModelAdmin to manage global contentblocks

18 November 2010 at 7:27am
I've very big interes.
Can I see code, instructions, examples?Thanks
| 1648 Views | ||
|
Page:
1
|
Go to Top |



