I tried to install ckeditor in php but no result :S.
i have uploaded ckeditor file into the root of the site and i have a editor.html file where i have this code:
<html>
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<form method="post">
<p>
My Editor:<br />
<textarea id="editor1" name="editor1"><p>Initial value.</p></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1' );
</script>
</p>
<p>
<input type="submit" />
</p>
</form>
when i open the page it doesnt show the toolbar except a simple textarea.
Does any of you knows what I am actually missing here?
I don't know if this was your case, but in case it helps anyone else in the future...
I was adding CKEditor to my project and the toolbar wasn't showing for me either. I could tell the javascript file was loaded (and css files). There were no javascript errors either.
Eventually I narrowed it down to a conflict between a jquery plugin (jquery.stylish-select) and CKEditor. When I removed the plugin, the toolbar showed up perfectly.
Maybe you can try this:
CKEDITOR.replace('editor1', {width: 1050, height: 500, uiColor: '#e1e1e1'});
that means, you change the size....
So, can be, that it is better to use this CODE
Related
Is it possible to use the same ckeditor that TYPO3 (8.7.11) uses in the frontend too?
I have to implement a user form with an editor and I want the frontend user to see exactly the result that is displayed in the backend - so I need to use the same editor.
Is there a way to use the same editor without installing the ckeditor plugin a second time? Maybe any functions to easily include it or something?
If you have already configured the CK-Editor it should be only a matter of creating something like this in your Template:
<html lang="en">
<head>
<meta charset="utf-8">
<title>A Simple Page with CKEditor</title>
<!-- Make sure the path to CKEditor is correct. -->
<script src="../ckeditor.js"></script>
</head>
<body>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'editor1' );
</script>
</form>
</body>
</html>
The ckeditor.js should be inside your Typo3-source-folder under:
typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/ckeditor.js
The code-example is taken from the CKEditor 4 Dokumentation which can be found here:
https://ckeditor.com/docs/ckeditor4/latest/guide/index.html
EDIT:
After testing this Code myself, I noticed that this does not work since the Typo3-Installation of CKEditor is missing the style.js-file which includes the
style-definition.
I downloaded the standard version of CKEditor from here:
https://ckeditor.com/ckeditor-4/download/
And inserted the style.js-file (located at the root level of the folder) in the same directory my ckeditor.js is located.
After adding the file, including this Code:
<script src="/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/ckeditor.js"></script>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'editor1' );
</script>
</form>
inside of any Template shoud add the ck-editor.
How to integrate CKEditor 4 in php page? I looked at similar topics such as how to add or embed CKEditor in php page, but when I extracted the zip file there is no file called ckeditor.php.
At the moment there's no PHP connector for CKEditor v4 as some features are still waiting to be ported from v3. Some people reported successful integration of v3 connector into v4 so you can always give it a try and use the code from the latest 3.6.x package.
See the post on the form to know more.
Sample form:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A Simple Page with CKEditor</title>
<!-- Make sure the path to CKEditor is correct. -->
<script src="../ckeditor.js"></script>
</head>
<body>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'editor1' );
</script>
</form>
</body>
</html>
I know this was asked before but i couldn't get it to work anyhow. What I am trying to do is to launch FancyBox on page load(on Magento). Seems simple enough but as I am not very familiar with JQuery, i am having some problems. The Code I got the work with manually clicking on the anchor is as follows:
<!-- FancyBox -->
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("a[rel=fancybox]").fancybox({
});
});
</script>
<!-- FancyBox -->
<p><a id="image_id" href="http://shop2.xsmoke.com/skin/frontend/infinitus/maxxi/images/logo-300x71.png" rel=iframeLink><img src="http://shop2.xsmoke.com/skin/frontend/infinitus/maxxi/images/logo-300x71.png" alt="" /></a></p>
What I have so far regarding automatic launch is:
jQuery(document).ready(function(){
$("#image_id").fancybox().trigger('click');
});
The rest is same. Can anyone help?
EDIT: Ok i have been trying to get it to work for hours now and I tried using plain JavaScript for clicking the anchor. I Wrote
function init(){
document.getElementById("image_id").click();
}
window.onload = init;
but it still doesn't click the anchor. When I try it on a basic html page locally it works, but on the Magento home-content.phtml on the server it doesn't.
Try
jQuery(document).ready(function(){
jQuery("a[rel=fancybox]").fancybox({});
jQuery("a[rel=iframeLink]").fancybox({});
$("#image_id").trigger('click');
});
<p>
<a id="image_id" href="http://shop2.xsmoke.com/skin/frontend/infinitus/maxxi/images/logo-300x71.png" rel="iframeLink">
<img src="http://shop2.xsmoke.com/skin/frontend/infinitus/maxxi/images/logo-300x71.png" alt="" /></a></p>
I finally got some parts working here: http://jsfiddle.net/trXBr/5/
but when I put the code back into my project and tried to browse using internet explorer; the button onclick events do not work. Interestingly the one button onclick function to show the dialog works in firefox and chrome. I was excited to have this working in the editor but now if this does not work with all browsers, then this is just really frustrating. I am using version 1.5.1
dojo.connect(loadBtn,'onClick',function(){
userDialog.show();
});
dojo.connect(butt,'onClick',function(evt){
showTab();
});
Any help/ideas appreciated.
EDIT:
Ok using the compatibility mode in IE helps to get the one function working which displays the dialog box.
So as you can see here I have an borderlayout where I want a tabcontainer to be displayed in the middle with a click of a button and this works fine in jsfiddler but not from my code in the browsers;
<div dojoType="dijit.layout.ContentPane" region="center" splitter="true">
<div id="mainTabContainer"dojoType="dijit.layout.TabContainer"
style="width:500px;height:100px;display:none">
<div id="tab1" dojoType="dijit.layout.ContentPane"
title="First Tab" selected="true"
closable="true">First Tab</div>
<div id="tab2" dojoType="dijit.layout.ContentPane"
title="Second Tab" closable="true">
Second Tab
</div>
</div>
</div>
so the display:none but when I click the button I call the following:
dojo.connect(butt,'onClick',function(evt){
showTab();
});
function showTab(){
dijit.byId("mainTabContainer").domNode.style.display = 'block'
dijit.byId("mainTabContainer").resize();
}
Also if I remove the display=none then the tabcontainer appears fine. So is these something wrong with my function call.
ok sorry guys....all my fault here...I forgot to remove the added code I had in my html in my asp.net code
<body class="claro">
<form id="form1" runat="server">
<asp:ScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ScriptManager>
Once I removed the form and scriptmanager lines it works fine..Thanks for everyones efforts.
Just worried that if I were to incorporate ajax and other controls, then would dojo still work
I would like to put a magento mini search box in my main website, so that when a search is made, it redirects to the magento search results page. This global search is in the header and helps to find products fast on my Codeigniter main site. I was able to achieve part of this, by placing the following code:
<form method="get" action="http://pathtomagento/catalogsearch/result/" id="search_mini_form">
<div class="form-search">
<label for="search">Buscar:</label>
<input type="text" class="input-text" value="" name="q" id="search" autocomplete="off">
<button class="button" title="Buscar" type="submit"><span><span>Buscar</span></span></button>
<div class="search-autocomplete" id="search_autocomplete" style="display: none;"></div>
<script type="text/javascript">
//<![CDATA[
var searchForm = new Varien.searchForm('search_mini_form', 'search', 'Buscar en el catálogo...');
searchForm.initAutocomplete('http://pathtomagento/catalogsearch/ajax/suggest/', 'search_autocomplete');
//]]>
</script>
</div>
The autocomplete function of the search box doesn't work, which is a main issue for me since it's a really useful feature. My main website is full of jQuery, and I know Magento uses prototype. So I managed to include the following scripts that seem to be required by the autocomplete Magento search box:
<script type="text/javascript" src="pathtomagento/js/prototype/prototype.js"></script>
<script type="text/javascript" src="pathtomagento/js/varien/js.js"></script>
Still no luck! I don't get any Console errors in Firebug, but I don't get any AJAX or autocomplete response either. Does anyone know what I could be missing?
Your magento installation has to be on the same server because you can't make crossdomain AJAX requests. Maybe that is the problem in your case?