Is there a set of tags, or some way to tell CMSB "do not mess with anything between these open/close tags"?

8 posts by 3 authors in: Forums > CMS Builder
Last Post: June 25, 2020   (RSS)

By Codee - June 17, 2020

My client is needing to copy-paste some blocks of 3rd-party code into pages on the website. This code is unique on each page...and there can be hundreds of pages...so hardwiring the code isn't really an option...and we're avoiding javascript as much as possible. 

So, on a productDetails.php page we have:

<?php if ($productsRecord['item_code']): ?>
  <div>
    <?php echo htmlencode($productsRecord['item_code']) ?>
  </div>
<?php endif ?>

- where item_code, obviously, references the field in CMSB products section where she copy-pastes the code into. 

The challenge that occurs is CMSB is processing that "item_code" block so that the browser shows the codeblock as full text and, thus, the browser doesn't process the code and make the magic happen. 

Is there a set of php tags that tells CMSB to "just post as is" and not convert anything? So, don't change things like

<form action="https

into

&lt;form action=&quot;https

This client is going to need to utilize 3rd-party code from several sources - so this is kind of a must and needs to be easy-peasy.

By Damon - June 17, 2020

Hi,

You should be able to just remove the htmlencode and then get the results you are after:

<?php if ($productsRecord['item_code']): ?>
  <div>
    <?php echo $productsRecord['item_code']; ?>
  </div>
<?php endif ?>

Let us know if this works or you.

Cheers,
Damon Edis - interactivetools.com

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

By Toledoh - June 17, 2020

There's also the Advanced Option to "Disable auto-formatting (don't add break tags to content)".  I've found this handy when allowing clients to add javascript and various tracking widgets to sites.

Cheers,

Tim (toledoh.com.au)

By Codee - June 23, 2020

Thanks, Tim!

By Codee - June 23, 2020

Hi Tim, "where" is that advanced option? I'm currently using cmsb version 3.53. 

By Toledoh - June 23, 2020

If you edit a field in the section editor, down the bottom of the options - as attached

Cheers,

Tim (toledoh.com.au)

By Codee - June 25, 2020

I see it, now, it's there when creating/editing a field that is a Text Box. Thank you so much for pointing that out, Tim! I appreciate it...and your continued helpful presence in these forums. 

Cheers!