Adding Individual Sidebar boxes/features

13 posts by 4 authors in: Forums > CMS Builder
Last Post: April 18, 2011   (RSS)

By csdesign - March 11, 2011

I'm just starting this site and I want to make sure I have the foundation right. I'm not completely clear on the best way to make this happen so any help would be greatly appreciated!

I've included a screenshot of what I'm trying to accomplish. I have 6 individual boxes/features I would like to include in the sidebar. Easy enough... however, I would like for the client to be able to change the order of the boxes on each page and only display 3 of the six per page.

4 of the boxes will be text only.
1 will have quotes/testimonials that could display randomly if possible, if not, no biggie.
1 will be using a user controlled slideshow script to display a photo and text together.

What's the best way to approach setting all of this up? Should I make each of the boxes their own editor to start with?

Thanks!! Tina

Re: [csdesign] Adding Individual Sidebar boxes/features

By Toledoh - March 12, 2011

Hi Tina.

I've done a similar thing to what I think you are doing (no screenshot).

I used a multi-record section to add "snippets" which consisted of title, text and image. I then randomly ('orderBy' => 'RAND()') display 4 of these records on a page.
Cheers,

Tim (toledoh.com.au)

Re: [csdesign] Adding Individual Sidebar boxes/features

By Damon - March 15, 2011

Hi Tina,

The screenshot didn't get attached. Can you try adding it again so I have a better idea what you are trying to setup?

Thanks!
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Damon] Adding Individual Sidebar boxes/features

By csdesign - March 15, 2011

sorry about that - must have gotten click happy!
Attachments:

picture-53.png 68K

Re: [csdesign] Adding Individual Sidebar boxes/features

By Jason - March 16, 2011

Hi Tina,

I think Tim definitely has the right idea. Have a multi-record section where you create 1 record for each "box" you want to display. When you're retrieving those records from the database, you can use code like this:

list($sideBarRecords, $sideBarMetaData) = getRecords(array(
'tableName' => 'sidebar',
'allowSearch' => false,
'limit' => 4,
'orderBy' => "RAND()",
));


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Adding Individual Sidebar boxes/features

By csdesign - March 16, 2011

Thanks guys! I'll try that out!

Re: [Jason] Adding Individual Sidebar boxes/features

By csdesign - April 4, 2011

The code worked great! Thank you!

Is it possible to add two more variations of the sidebar box layout to be included in the random display.

For example, right now all of the boxes use "boxList.php" and it's a simple title, subtitle & content display.

I would like to have to two additional box layouts that would display randomly in the mix with the first set. I've
already set those up as two single records: box2 and box3

For example:

• box2 would display 2 random testimonials automatically pulled from the testimonials page (patient_testimonialsRecords)
• box3 would be a small photo gallery using a js slideshow script

Essentially they will each have the same setup (title, subtitle & content area - testimonials & js slideshow)


I've attached a screenshot of what I have now. I'm assuming I can't just add another version of the box
layout in boxList.php but that I have to have new layouts (boxList2.php & boxList3.php).

I hope that all made sense. Thank you!! Tina


CURRENT CODE: (stripped down) =====================
<?php


// load records
list($boxRecords, $boxMetaData) = getRecords(array(
'tableName' => 'box',
'allowSearch' => false,
'limit' => '3',
'orderBy' => 'RAND()',
));

?>

<?php foreach ($boxRecords as $record): ?>
<?php echo $record['title'] ?>
<?php echo $record['subtitle'] ?
<?php echo $record['content'] ?

<?php endforeach ?>
<?php if (!$boxRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
Attachments:

picture-10_001.png 112K

Re: [csdesign] Adding Individual Sidebar boxes/features

By Jason - April 5, 2011

Hi Tina,

I'm not sure I understand where you're running into difficulty. You can pretty much use the same code to get your 2 random testimonials. Assuming that your tablename is testimonials, you could use something like this:

// load records
list($boxRecords, $boxMetaData) = getRecords(array(
'tableName' => 'testimonial',
'allowSearch' => false,
'limit' => 2,
'orderBy' => 'RAND()',
));


Exactly how we'd create your slideshow would depend a lot on which slideshow script your using. If you need us to integrate this in for you, that is something we could do through our consulting service. If you interested in looking into some options for that, please email consulting@interactivetools.com.

Hope this helps get you started. Please let me know if you have any other questions.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Adding Individual Sidebar boxes/features

By csdesign - April 5, 2011

Hi Jason,

I'm sorry, I don't think I explained it very well. I think my confusion lies with having 6 "boxes" that I want to come up in the sidebar (3 of which are displayed randomly) and I wasn't sure how to go about setting it up since 4 are text only, one is pulling in testimonials and one is a slideshow gallery.

I'll go ahead and jump into it and see what I can accomplish. Thanks!! Tina