Changing the way the wysiwyg shows in the Multi Record List of Records

9 posts by 3 authors in: Forums > CMS Builder
Last Post: December 18, 2013   (RSS)

By Damon - December 6, 2013

Hi,

The multi-record list in the CMS Builder admin will show the full contents of whichever field you choose to display.

So if there is html content in a field, that will be display. It is usually best to display fields that are using a textfield
for adding contents as html isn't usually displayed in that.

An alternative is to add additional fields that are just used for displaying content in the admin. This is extra work for the user
as they will need to enter this content.

Is it possible for at least the Title field to use a plain textfield instead of WYSIWYG editor for content. In the template you can set the
html tags as needed (<h2><em> etc.)?

Cheers,
Damon Edis - interactivetools.com

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

Damon,

I would have liked the client to be able to put bold, underlined, italic text where he would like.
It's a pity and strange that this is not possible!

That best way would have been if this had an option to display text with or without tags.
Another great option would be formatted and/or formatted text with an option for a number of characters.
And for both option where there are graphics and or files there should appear a small icon with file type (extension) with a mouse over option to see the name of the file.

You guys should really add this to the WYSIWYG editor.

Regards,

Tim

By Dave - December 8, 2013

Hi Tim, 

Creating snippets or text only versions of wysiwyg content is notoriously tricky and very difficult to do consistently.  You have to deal with all kinds of issues such as image only content, content that starts with tables, truncating content without malforming the html, etc.

That said, if you'd like to update the code to show the wysiwyg code inline so bold appears as bold, etc, try making these code changes (backup first):

  1. Open /cmsAdmin/lib/menus/default/list_functions.php
  2. Search for: nl2br
  3. Add the code in red:

  // v2.50 - display formatted textbox content
  if (@$fieldSchema['type'] == 'textbox') {
    if ($fieldSchema['autoFormat']) {
      $displayValue = @$record[$fieldname]; // overwrite previous htmlencoded value
      $displayValue = preg_replace("/<br\s*\/?>\r?\n/", "\n", $displayValue);  // remove autoformat break tags
      $displayValue = htmlencode($displayValue); // html encode content
    }
    $displayValue = nl2br($displayValue); // re-add break tags after nextlines
  }

  // v2.54 - display wysiwyg content
  if (@$fieldSchema['type'] == 'wysiwyg') {
    $displayValue = @$record[$fieldname]; // overwrite previous htmlspecialchars encoded value
  }

  // return display value
  return array($displayValue, $tdAttributes);
}

Let me know if that works for you.  You might find that it expands the list page too much, but you can add any other code inside the if {} block if needed to convert to text, truncate, etc.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

Hi Dave,

Today I got a chance to test the way the wysiwyg shows.
It does show all formating.

It shows size, bold and underline.
It does not show color in conbination with bold formatting...!!!

Is this possible?
I would also like the option to display plain text (NO-FORMATTING) when viewed in the Records list.
I attached 2 screen shots as refference.

Regards,

Tim

By Damon - December 17, 2013

Hi Tim,

It shows size, bold and underline.
It does not show color in conbination with bold formatting...!!!

In both screenshots, the text "omni blacea" appear bold and pink.  Can you give me an example?

I would also like the option to display plain text (NO-FORMATTING) when viewed in the Records list.

It may be a little tricky to strip out all the HTML and CSS perfectly but it probably could be done with some custom coding and through a plugin. That way there won't be any issue when upgrading in the future Send an email into consulting@interactivetools.com and reference this forum post and we can get back to you with details(time and price).

Thanks!

Cheers,
Damon Edis - interactivetools.com

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

Hi Damon,

In both screenshots, the text "omni blacea" appear bold and pink.  Can you give me an example?

The "omni blacea" isn't bold!!!
And the problem is bold... it doesn't show color in Multi Records List.
What is strange is that an underline bold text displays the underline in color and the text in black in Multi Records LIst.

It may be a little tricky to strip out all the HTML and CSS perfectly but it probably could be done with some custom coding and through a plugin. That way there won't be any issue when upgrading in the future Send an email into consulting@interactivetools.com and reference this forum post and we can get back to you with details(time and price).

If this is to difficult lets try to display the information in the Multi Record List as formatted in the wysiwyg.
If this is really difficult or not possible, than I'll change back to text box.
I really wanted this to be possible for the client to be able to use bold text etc. and see the in the Multi Record List.

A great option for the CMS Builder in the future:
This option should be possible when you setup the wysiwyg. With a checkbox to dsiplay the info as is in the Multi Record List or as html.
Another option would be to let the wysiwyg display graphically when the option to preview in Multi Record List is choosen.
I'm just inventing something right now. I don't know if it is possible. And this should happen when you press save it makes a JPG of the wysiwyg edited and displayes this even smaller or partially if possible.
This would be a great option for CMS Builder in the future.

Let me know what can be done now!!!

Regards,

Tim

By Damon - December 18, 2013

Hi Tim,

The problem that is happening is that the WYSIWYG content that is displayed in the Multi Records list is picking up some styles from the CMS Builder admin CSS.

Maybe there is another way to get the results that you are after outside of the admin. What about creating a password protected multi record list page on the front end of the site with links to edit?

You could have the content display exactly as needed and the user would already be logged in, so when they clicked an edit button, they would go right into the admin edit screen for that record.

Let me know if this makes sense and may be an option.

Cheers,
Damon Edis - interactivetools.com

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

Damon,

Yeap seams better.
If this works back and forth would be even better!!!

Regards,

Tim