Unwanted space after record is called

5 posts by 3 authors in: Forums > CMS Builder
Last Post: May 22, 2013   (RSS)

By gkornbluth - May 22, 2013 - edited: May 22, 2013

Hi dccreatives,

I might have missed something but i can't see any reason in your code why there should be a space.

I thought it might be an errant space with the <?php echo $record['mounting-french']?> and S being on a separate code line, but it's not.

I'd suggest putting the <?php foreach ($galleryRecords as $record): ?> inside the div and after Galerie Photos -, like this:

   <div class="breadcrumbs">
 Galerie Photos -  <?php foreach ($galleryRecords as $record): ?><?php echo $record['mounting-french']?>S<?php break ?><?php endforeach ?>

</div>

Silly question, but are you sure that there isn't a space in the field entry itself after SUSPENSION? (I just looked, and you're getting the space after all the titles so there probably isn't but I thought I'd ask anyway.)

Is mounting-french a text field?

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gregThomas - May 22, 2013

Hi,

I would try using the PHP function trim, this will remove any white spaces from the beginning or end of your variables:

<?php echo trim($record['mounting-french'])?>S

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By dccreatives - May 22, 2013

I found the issue. I regenerated the code and got this: <?php echo join(', ', $record['mounting-french:values']); ?>S

That worked without a space.

By gkornbluth - May 22, 2013 - edited: May 22, 2013

Glad you fixed it.

There's a (free) plugin that Dave Edis from Interactive Tools developed a while ago to insure that blank spaces and dates do not mess up your code.

You can download it from the CMSB Cookbook download center at:

http://www.thecmsbcookbook.com/downloads/removeExtraWhitespace2.zip

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php