Header Bar Separator Issue

11 posts by 3 authors in: Forums > CMS Builder
Last Post: October 24, 2016   (RSS)

Hi All,

In recent versions of CMSB, I’ve noticed that Header Bar separators that have formatting code in them like:

<font color="red"><b>SHOW IN CURRENT NEWSLETTER OR ON WEB SITE</b></font>


show up correctly as Red and Bold text in the section editor, but when I go to a record in the section, I see the complete code and text without the formatting.  

Any suggestions?

Thanks,

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 Daryl - October 6, 2016

Hi Jerry,

Can you please try using the HTML separator instead of the header bar and add the following HTML:

<div class="separator "><div><font color="red"><b>SHOW IN CURRENT NEWSLETTER OR ON WEB SITE</b></font></div></div>

And please let me know if that works for you.

Thanks,

Daryl Maximo
PHP Programmer - interactivetools.com

Hi Daryl,

Thanks for looking at this.

It does work, however there are a few serious issues with going this route.

1) I and many other developers have multiple sites with many header bars that have been styled.

2) It would be a great deal of work to find and then to restyle all existing header bars.

3) the html separator has never, and does not now display its contents in the section editor. Instead it only displays ---html -- and separator #, which makes them not as useful as they might be.

Based on the above, it would really be beneficial if header bar styling worked as it did prior to V 3.0

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

By Daryl - October 11, 2016

Hi Jerry,

Thanks for your inputs, I will discuss it with our senior programmer.

Regards,

Daryl Maximo
PHP Programmer - interactivetools.com

Much appreciated,

Jerry

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 Dave - October 19, 2016

Hi Jerry, 

Can you try this patch (we'll have this in the next release):

In /lib/admin_functions.php search for "to display even" and replace this line:

$attrs['label'] = $attrs['label'] !== "" ? htmlencode($attrs['label']): '&nbsp;'; // default to &nbsp; to display even with empty string

With this line:

$attrs['label'] = $attrs['label'] !== "" ? $attrs['label'] : '&nbsp;'; // default to &nbsp; to display even with empty string

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

Thanks Dave,

That made all the difference!

Works perfectly and made it much easier.

Any chance that showing the contents of html separators in the field list is as simple a fix?

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 Dave - October 20, 2016

It should show for "Header Bar" separators, but not HTML ones.  You mean for HTML ones? 

Dave Edis - Senior Developer
interactivetools.com

By Dave - October 24, 2016

Hi Jerry, 

Ok, got it.  Try this quick fix: 

In /lib/menus/database/editTable_functions.php

And replace this block: 

if (@$field['type'] == 'separator') {
  if ( @$field['separatorHeader']) { echo "<div class='text-center' style='line-height: 200%'><b>--- {$field['separatorHeader']} ---</b></div>\n"; }
  else                             { echo "<div class='text-center'>--- {$field['separatorType']} ---</div>"; }
}

With this block: 

if (@$field['type'] == 'separator') {
  $htmlAsText = htmlencode(mb_strimwidth(strip_tags($field['separatorHTML']), 0, 50, "..."));
  if     ($field['separatorType'] == 'header bar') { echo "<div class='text-center' style='line-height: 200%'><b>--- {$field['separatorHeader']} ---</b></div>\n"; }
  elseif ($field['separatorType'] == 'html')       { echo "<div class='text-center' style='line-height: 200%'><b>--- $htmlAsText ---</b></div>\n"; }
  else                                             { echo "<div class='text-center'>--- {$field['separatorType']} ---</div>"; }
}

That will display up to 50 characters of the "text" from the -- html -- fields.  We'll include that in the next release and also enable the "Field Label" field so you can manually specify a field label to be displayed in the field editor as well if desired.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com