I have a xml file with content
<ul>
<li><info>Some text here</info></li>
</ul>
I have parsed the xml file and show this in a page.info is a css class.In the page the text showing with css.When i am editing the content in tinymce editor how i can apply the css in the editor.In the editor the text is showing like <div mce_name="info">CSS text formatting </div>Thanks in advance.
Add the styles to the tinymce style sheet, they should appear in 'styles' the drop down.
Related
I am making a wordpress plugin, you can edit a page's title with it.
The title will be an H1 Tag with the ID of featuredTitle.
<h1 id="featuredTitle">This text will be replaced!</h1>
Now I need an input that opens the file "myPage.php" and replaces the text.
I am new to PHP so help would be highly appreciated.
I have a database of blogs. In the body field, I have html. Essentially, it is the body of the blog post with all the markup, including tags that references the path to various images. In the admin area, I have a list of posts but in the list I don't want to to display any of the images.
Here is an example of the 'body' field:
<p>This is some text. This is a pict. <img alt=""
src="/ckfinder/userfiles/images/picts.jpg" xss="removed"></p>
There could be more than one image and in various formats.
Also, how can I get the value of 'body' without it rendering the html? Whenever I say, $item['body'] the html is rendered but I would like to see the html instead.
In your CSS, you may target images in the admin area where the post is displayed to hide them.
.admin-area .post-body img {
display:none;
}
But there would be no need to do the above if you choose to use either of the below functions.
If you would like to display the post body without rendering the HTML:
To show text only: strip_tags($item['body']);
To show HTML as text: htmlspecialchars($item['body']);
I am using CK Editor 4.5 as text editor in my form.
I have pasted my html code including "style" tags to the editor. But when saving the data it automatically removes the style tags from the code.
I have tried to turn off Automatic Content Filtering by add this to config file
config.allowedContent = true;
But it still remove the style tags. The editor also removes the text color, text align styles added.
How can i add style tags using CK Editor.?
My apologies. Its not the issue of ckeditor.
I am using codeigniter for server scripts. It removes inline style on form submit.
I'm using Rails and met the same issue, it turns out that I'm using sanitize to render content, which will remove the inline styles.
i have problem in displaying an image in textarea
please help me to solve it
thanks
Textareas can only hold plain text. Use contenteditable or a fully functional editor, like TinyMCE to save you the troubles.
As anothershrubery already mentioned, textarea can only hold plain text.
You can instead use a div element with the contenteditable attribute set to true.
<div contenteditable="true">
You can edit this text and also add images! <img src="smiley.jpg" alt=":)" />
</div>
There are also many different JavaScript WYSIWYG editors which uses the above method or an iframe in designmode.
Here's a couple of them:
Aloha Editor
MarkItUp
TinyMCE
Lightweight RTE
CKEditor
You cannot display images in a textarea. Textarea's just accept plain text.
Textarea support text only, if you want to display image/ link or any thing else, use WYSIWYG HTML Editor
You can try this, a really good one ;)
http://premiumsoftware.net/cleditor/
You can try this:
HTML:
<div id="image_txtarea" style="width:auto">
<img src="image/Example.jpg" id="image" style="position:absolute"/>
<textarea id="some" style="position:absolute;display:none"></textarea>
</div>
JQUERY
$('#image').click(function(){
var img = $('#image');
$(this).hide().next('textarea').show().css({'background':'url('+ img.attr('src') +') no-repeat center center','width':img.width(),'height':img.height()});
});
The answer is yes, image can be placed in textarea.
I placed an animated gif in textarea (worked in ie-6 and ff-13.0.1) with this technique:
Convert any image into a base64 string. (free online converters available, there is a limit to the base 64 file size - around 30k image size); a simple url() background statement did not show image for me.
The online converters usually output both an <img> tag and a CSS background property with the correct values from the uploaded image. Just copy and paste the CSS output into your own file. use url data statement - url(data:image/ext.....)
use the base64 css as a background in the style statement.
to change images, you'll have to change div id="" or class where you have base 64 defined as background-image in the class or id.
time consuming to do conversions so make sure that you really want an image in a textarea before you start.
I have a xml file with data
<ul>
<li><info>CSS text formatting </info></li>
<li><info>Text loaded from a XML</info></li>
<li><info>Scrolls with easing</info></li>
</ul>
For editing the content i have used tinymce editor.For editing i am parsing the xml file and putit in a textarea that is for timymce edtor.In the editor i am getting the <info> tag after the <li> tag.But when iam submitting the value the <info> tag is not getting.How i can get <li><info>Text loaded from a XML</info></li> when i am submitting the form.Thanks in advance.
info is not a valid html tag.
Add this code in tinymce configuration
extended_valid_elements : "info",
custom_elements: "info",