Can I get cms builder to create listings within these div boxes?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 10, 2014   (RSS)

By willydoit - June 9, 2014

Hi all,

I am in the middle of rewriting one of our sites and am using a pre-created template the reasons for which I wont bore you with, anyway one of the pages supplied with the package is this one http://www.buybridish.co.uk/about.htm and I noticed the box designs under meet the team, the code for which is copied below. The code creates a set of three boxes.

What I would like to be able to do is have cmsbuilder create one of these div boxes for each of the listings in the database but to also create a new row after each three.

Is this possible, I would rather not use tables as the main reason for the rewrite is to create a site which is fully responsive and caters for mobile and tablet display as well as the usual desktop.

The coding of the pages facilitates our responsive needs so I want to stick as close to the existing coding as possible.

I know this can be done with tables but is it possible to do it using div tags such as the ones in the example below?

I am not a programmer of either php or css which makes the matter a tad difficult but any advice as to if it could be done would be appreciated.

Thanks in advance for any help provided

<div class="row-fluid">
<ul class="thumbnails">
<li class="span4">
<div class="thumbnail">
<img src="Pages/Site/themed-images/placeholders/200x150/holder1-200x150.jpg" alt="ALT NAME" class="img-circle">
<div class="caption">
<h3>Agent Name</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<p><a href="#" class="btn btn-primary">Facebook</a> <a href="#" class="btn">Tweet</a></p>
</div>
</div>
</li>
<li class="span4">
<div class="thumbnail">
<img src="Pages/Site/themed-images/placeholders/200x150/holder2-200x150.jpg" alt="ALT NAME" class="img-circle">
<div class="caption">
<h3>Agent Name</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<p><a href="#" class="btn btn-primary">Facebook</a> <a href="#" class="btn">Tweet</a></p>
</div>
</div>
</li>
<li class="span4">
<div class="thumbnail">
<img src="Pages/Site/themed-images/placeholders/200x150/holder3-200x150.jpg" alt="ALT NAME" class="img-circle">
<div class="caption">
<h3>Agent Name</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<p><a href="#" class="btn btn-primary">Facebook</a> <a href="#" class="btn">Tweet</a></p>
</div>
</div>
</li>
</ul>
</div>

By claire - June 9, 2014

Hi Willy

CMSB can definitely do this, but it does involve mucking about with some PHP loops and conditional statements. You can't really get away from it, unfortunately.

If you post the generated viewer listings code here, I'll just merge it into what you've got below. Hopefully you'll see how it works so you'll be able to use something similar elsewhere if you need to.

--------------------

Claire Ryan
interactivetools.com

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

By claire - June 10, 2014

Hi Willy

This looks good, I expect it will work.

You may have to tweak it, though. If the design assumes only three listings per line (even if it's responsive), it could break on this, because the PHP code is going to put a variable number of listings into the row. Best thing to do is try it out and see how it handles more than three listings, and test it on a couple of different devices.

--------------------

Claire Ryan
interactivetools.com

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