Try to display code in the WYSIWYG

8 posts by 3 authors in: Forums > CMS Builder
Last Post: May 16, 2011   (RSS)

By incube - May 14, 2011

Hi I did a blog with the CMS builder. I'm trying to display some code inside it.
I want to put some HTML, CSS and JAVASCRIPT to be displayed as is.
In the wysiwyg field, I clicked on the HTML and put my HTML. When there is a place I would like to display code I put
<pre><code class="prettyprint"> the code... </code></pre>
It doesn't work. I mean wysiwyg modify my code.
I would like to have a way to put some code in the field wysiwyg that it will not be modify or interpreting.
Most blog have a CODE tag that do the trick.

Thank you

Re: [incube] Try to display code in the WYSIWYG

By gkornbluth - May 14, 2011 - edited: May 14, 2011

Hi incube,

Not the perfect solution, but <textarea> your code...</textarea> shows the code as code.

Try this in the HTML of the WYSIWYG editor as an example:

<p>Here's some code</p>
<p><br /><textarea style="width: 162px; height: 24px;"><br> < span class="blue"></textarea></p>
<p><br />And Here's some more text after the code block. </p>


You can re-size the code block by dragging it's borders or if that fails, adjust the height and width of the style in the html.

Hope that helps.

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

Re: [gkornbluth] Try to display code in the WYSIWYG

By incube - May 14, 2011

Naaaa doesn't work.
You can see what I mean there:
http://beta.rdsign.net/code/article_6
It work for light html. But as soon as I put my complex structure it strips all my code and doesn't render the good thing. I should maybe use a Textbox instead and put my html inside it.

Re: [incube] Try to display code in the WYSIWYG

By gkornbluth - May 14, 2011

Sorry,

I don't have a better idea.

Can you do something with popups or links to code pages?

Please post your solution.

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

Re: [gkornbluth] Try to display code in the WYSIWYG

By incube - May 14, 2011

Well I could certainly use something like a lightbox. But I will need to put the code in the wysiwyg too. So the code will be alter and rendered and will get the same result I guess.

There is so much blog with a Code tag that work. There is certainly a way to do it. CMS Builder should care about people who want to create a blog with there great CMS.

Re: [incube] Try to display code in the WYSIWYG

By Jason - May 16, 2011

Hi,

In the wysiwyg editor, in the drop down box where you see "Paragraph" there's an option for "Preformatted".

Try this and let us know if that works for you.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] Try to display code in the WYSIWYG

By incube - May 16, 2011

Nice it's working great.
I found another way too.
In html I pasted :
<pre><code class="prettyprint">short text</code></pre>
I go back in normal view and replace the short text with my html, javascript or css code.
It's a bit painfull but it did the job.
Your method is simplier than mine. Thank you.