Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Content regions into JQuery Accordion


Reply


4 Posts   2086 Views

Avatar
Greg1

Community Member, 28 Posts

11 September 2009 at 11:33am

Edited: 09/03/2010 6:13pm

Hi,

I am using JQuery Accordion to display some content on my site. Currently I am just placing the required code in the HTML tab of the WYSIWYG editor and it is working ok. But, I would like to create a content region for each section of the accordion so that I don't need to put code into the editor. I'd prefer not to create a new page for each piece of content and there is no fixed number of sections in the Accordion.

You can see it on my site: http://www.travel-insurance-reviews.com/1cover-travel-insurance/

Can anyone point me in the right direction?

Avatar
zenmonkey

Community Member, 528 Posts

11 September 2009 at 5:13pm

Well you could always use the DataObjectManager Module. It'll let you create complex dataobjects that aren't pages

Avatar
lawless

Community Member, 33 Posts

11 September 2009 at 8:44pm

The DataObjectManager seems like a good idea for this purpose.

You would create fields for each of the areas in your accordions and then just use a %control% to loop through the DOM and display each accordion menu.

Example using your code structure:

%control loop%
<h3><a href="http://#">DOM field 1</a></h3>
<div>
<h4>DOM field 2</h4>
DOM field 3 with accordion panel content
</div>
%end control loop%

Avatar
Greg1

Community Member, 28 Posts

14 September 2009 at 11:02am

Thank you for the help. I'll check out DataObjectManager.