I am really doubt that it is impossible to disable text editor in shoutbox (mode full or in popup window).
if i remove this (in shoutbox template):
{parse editor="shout_msg" content="" options="array( 'height' => 100 )"}
then editor is disabled, but i can't send any messages(no input fields).
The question is: how to disable any text editors in popup or full mode. ( for example in root mode only one text field and some buttons. but in full mode we have fully CKEditor or something else..). i want keep only one text input field and only..
I got it. just replace Popup template ( shoutbox ) with hookGlobalShoutbox template. and replace all $d with $data will work. (also the javascript is needed to be inserted at the top)
<script type='text/javascript' src='public/js/shoutbox.js'></script>
<script type='text/javascript' src='public/sounds/soundmanager2-nodebug-jsmin.js'></script>
save and go..
but after that any shout edit cannot be done ..
Related
Is there any possibility to add another protocol to the hyperlink-type in sharepoint?
I want to add a notes (notes://***) to the top level navigation-bar.
Is there something I can extend or where I can edit the validation
By default, SharePoint navigation Hyperlinks must begin with http://,https://,mailto:,ftp://,file://,/,# or \.
If you want to use the "notes://***", as a workaround, you can add the link using jQuery code.
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$(".ms-core-listMenu-horizontalBox>ul>li>ul").append("<li class='static'><a href='notes://xxx'>MyNote</a></li>");
});
</script>
Probably it is not possible to turn off easily the OOB link validation without any customization. Depends on the output You need maybe You could use a note column and in edit HTML content of the filed just put the link tag manually like:
someLink
. After save SharePoint will render it as link on list webpart.
I would like to be able to replace multiple text area by ckeditor, but they will all have the same ID. Do you know how to do, because now, after loading one editor, it stops.
The actual JavaScript code:
<script>
CKEDITOR.replace( 'advance_editor' );
</script>
Thank you !
In Joomla 3.0, an empty <a> tag with class="nolink"(ie,) is inserted for every <ul> and <li>.
Advice me how to remove this.
We are creating the component and we are creating the tabs as of default component (for ex Newsfeed component edit page).On the first tab position the <a> tag is created.
I think I have found the problem.
This is due to a tag which is unclosed in the /administrator/modules/mod_submenu/tmpl/default.php file in line 26.
A ticket has already been created on JoomlaCode: [#29623] Missing closing link tag in submenu layout
We just have to wait the next Joomla version.
You can also add the '</a>' tag at the end of the line 26 like this:
?><a class="nolink"><?php echo $item[0]; ?></a><?php
Change the following code in the function addtoolbar in the view.html.php file.
Change the mainmenu params as false in the edit page view.
JFactory::getApplication()->input->set('hidemainmenu', false);
If we need to display the mainmenu using the above code, then the following code <a class="nolink"></a> doesn't generate in the edit page.
I tried all the default editors that came with Joomla 3.0:
(In Users -> User Manager -> Super User -> Basic Settings -> Editor:)
Editor - CodeMirror
Editor - None
Editor - TinyMCE
That problem didn't occur here. I also tried using the button on TinyMCE editor to add the ul and li tags.
Can you give more details on how did you add those ul and li tags?
What editor are you using?
I use CKEditor to insert some content in 'wysiwyg' mode. I input Hello, world! in the editor, and the real context inserted into database is <p>Hello, world!</p>.
Now I load the data from database and set it into CKEditor:
String content = loadFromDb();
// --> <p>Hello, world!</p>
CKEditor.instances['test'].setData(content);
But in the CKEditor, it shows:
<p>Hello, world!</p>
in 'wysiwyg' mode. When I click 'source' button, it shows:
<p> <p&rt;Hello, world!</p></p>
How can I set the data as html code, and I can see only Hello, world! in CKEditor on 'wysiwyg' mode?
Did you try simply using the insertHtml command? If you are loading it into a blank editor or not it should do the right thing. There is a function that strips off the tags too, bujt I don't recall that right now...
I am using ckeditor on my website to make it easier for users to input HTML.
However, the data I get back from ckeditor is wrapped in <p></p> blocks. (Which I don't want.)
Is there some configuration setting that forces the editor to not wrap the text in anything?
Add the following to your config.js file for CKEditor:
config.enterMode = CKEDITOR.ENTER_BR;
Example:
...
CKEDITOR.editorConfig = function (config)
{
config.enterMode = CKEDITOR.ENTER_BR;
...
};
Details
The configuration setting that controls this behavior is based on what you want to happen when the user presses Enter.
Just in case someone who's new to working with HTML reads this, I'm including some basic explanation of the concepts involved and why a tag will need to be inserted when the Enter key is pressed.
We know that if we enter some text into an HTML document and then put additional text on a new line, the browser won't display the text as two lines, it will ignore any carriage returns and will condense multiple spaces between characters to a single space.
The following HTML:
qwer
tyui
Will be rendered as:
qwer tyui
So the editor needs to insert an HTML tag to tell the browser that it should display the second group of text on a new line.
The configuration setting that controls this is config.enterMode and it offers three options:
1 - Insert paragraph
The default setting creates a paragraph element each time Enter is pressed:
config.enterMode = CKEDITOR.ENTER_P; // inserts `<p>...</p>`
2 - Insert 'div'
You can choose to create a div element instead of a paragraph:
config.enterMode = CKEDITOR.ENTER_DIV; // inserts `<div></div>`
3 - Insert break (the setting you're looking for)
If you prefer to not wrap the text in anything, you can choose to insert a line break tag:
config.enterMode = CKEDITOR.ENTER_BR; // inserts `<br />`
The CKEditor documentation indicates that using the ENTER_BR setting is not recommended:
Note: It is recommended to use the CKEDITOR.ENTER_P setting because of its semantic value and correctness. The editor is optimized for this setting.
Another related setting 'autoParagraph'
There is a second setting that controls a similar situation –config.autoParagraph. How it functions depends on the config.enterMode setting discussed above.
autoParagraph determines whether inline elements such as span are wrapped in the block element (p or div) specified by the enterMode setting. The default is to wrap inline elements, so if you enter a span like this (as HTML):
<span>asdfg</span>
It will be wrapped in a p or div element like this:
<p><span>asdfg</span></p>
or this:
<div><span>asdfg</span></div>
The inline element won't be wrapped if you set this to false or if you set enterMode to CKEDITOR.ENTER_BR.
The CKEditor documentation includes this note about config.autoParagraph:
Note: Changing the default value might introduce unpredictable usability issues.
Even more settings
There are three more settings that are somewhat related to this subject:
config.fillEmptyBlocks
config.forceEnterMode
config.ignoreEmptyParagraph
Reference
A complete list of the available configuration options can be found here:
CKEDITOR.config - CKEditor 3 JavaScript API Documentation
CKEDITOR.config - CKEditor 4 Documentation
I know I'm a little late to the game, but I think the option the OP is looking for is:
config.autoParagraph = false;
This is answered perfectly well above, however as mentioned you should not really be changing this in the main config.
The correct way to do this is per .replace really.
i.e.
<form name="title" method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']);?>">
<textarea id="editor2" name="editor2" rows="300"><?php echo $editor2;?></textarea>
<textarea id="editor1" name="editor1" rows="1" cols="50" onfocus="this.value=''; this.onfocus=null;">Type Tab Title Here:</textarea>
<input type="submit" value="Submit">
</form>
<script type="text/javascript">
CKEDITOR.replace( 'editor2', {
enterMode: CKEDITOR.ENTER_BR,
on: {'instanceReady': function (evt) { evt.editor.execCommand('maximize'); }},
});
</script>
A very simple solution without any configuration change is to use
shift+enter for a line break <br>, and
just enter would cause a new paragraph.
Advantage is that you don't have to do any configuration changes. Plus, you have both.
If you want to exclude <p> tag and want only basic editing tool like Bold Italic superscript Subscript etc in Ckeditor then follow these steps:
I am 100% sure about this as I researched 36 Hours continuously :)
Step 1: Add this script in your PHP webpage
<script type="text/javascript">
CKEDITOR.replace( 'editor1', {
enterMode: CKEDITOR.ENTER_BR,
on: {'instanceReady': function (evt) { evt.editor.execCommand('');}},
});
</script>
Step 2: add id="editor2" and onfocus="this.value='';" in your textarea like this
<textarea id="editor2" name="AsYourWish" onfocus="this.value='';">
Step 3: Be sure that remove Class="ckeditor" from Textarea.
Step 4: Reload your webpage if not happened Delete Cache/History and Restart PC/laptop.
Step 5: Its Done :)
For Django-ckeditor add this config in your settings.py file:
ENTER_P = 1 # default
ENTER_BR = 2
ENTER_DIV = 3
CKEDITOR_CONFIGS = {
'default': {
'enterMode': ENTER_BR,
},
}
If anyone comes here with ckeditor 5, don't look for this option. They have removed it, I've spent days tyring to figure this out.
I'm afraid you're not going to like it, but enter mode BR is the root
of all evil. If we were able we'd removed it from CKEditor 4 long time
ago and we're definitely not going to implement it in CKEditor 5.
Related GitHub issue