ModifyHomepage with CMSB 3+

6 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 1, 2016   (RSS)

In order to get this working the way it should, I had to make a change to the base software - I have not worked with InteractiveTools yet to find out what, if any, problems will occur because of this:

function _adminUI_inputArraysToHTML($args) {
 
  // caller must supply PAGE_TITLE as an array
  if (is_array(@$args['PAGE_TITLE'])) {
    $pageTitleHtml = '';
    foreach ($args['PAGE_TITLE'] as $label => $url) {
      if (is_int($label)) { $label = $url; $url = null; } // allow [ 'foo' ] to be a shortcut for [ 'foo' => null ] (instead of [ 0 => 'foo' ])
      if ($pageTitleHtml) { $pageTitleHtml .= ' > '; } // separate breadcrumbs with " > "
      // append $label (and optionally link it to $url)
      if ($url)           { $pageTitleHtml .= '<a href="' . htmlencode($url) . '">' . htmlencode($label) . '</a>'; }
      else                { $pageTitleHtml .= $label; /*htmlencode($label); */                                                 }
    }
    $args['PAGE_TITLE'] = $pageTitleHtml;
  }
  elseif (@$args['PAGE_TITLE']) { die(__FUNCTION__ . ": PAGE_TITLE must be an array"); }

Effectively, I had to remove the htmlencode for page titles that were not label->url combos.

Again, please note, this has not been an accepted solution by InteractiveTools, so only use if you are absolutely sure you need to tweak this base code module for your needs.

By Damon - March 1, 2016

Hi Gary,

I just tested the Modify Homepage v1.00 with CMS Builder 3.02 and it worked for me without changing any library files.

Attached is a screenshot that shows the Modify Homepage working with links, image and text.

What version of CMS Builder are you using?

Cheers,
Damon Edis - interactivetools.com

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

modify_homepage_example.png 105K

Hi Damon,

The problem is HTML markup in the TITLE portion of the page, not the content portion.

Thanks,

Gary.

By Damon - March 1, 2016

Hi Gary,

OK, I see what you are referring to. In the Modify Homepage plugin, the title area was only suppose to be used for text. This is why everything was output inside H2 tags. It was never designed for adding HTML and doing so usually caused formating and other issues.

Make note of your custom code change in a log with CMS Builder as a future upgrade will overwrite it and you will need to make that change again.

Another option is to leave the title area empty, which will create a narrow grey title bar. Then all the content could be just added to the main content area.

Cheers,
Damon Edis - interactivetools.com

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

Putting it all in the body may make the most sense.  I'll take a look at that and see how it goes.  I'd rather do that than to mess with the standard code.

Gary.