wysiwyg editor and patTemplate
-
- Joomla! Enthusiast
- Posts: 166
- Joined: Thu Aug 18, 2005 11:45 am
wysiwyg editor and patTemplate
How does one go about getting patTemplate and wysiwyg editors to work together? How does the PHP code look like? Any help would be deeply appreciated!
Cheers from
Ford
Cheers from
Ford
- Vimes
- Joomla! Ace
- Posts: 1675
- Joined: Fri Aug 19, 2005 12:14 am
- Location: United Kingdom
- Contact:
Re: wysiwyg editor and patTemplate
As it happens I've been experimenting with this today, trying to feed the editor into a template, unfortunately editorArea appears to be a javascript function (I should have figured that out just by looking at content.html.php, duh!) rather than something that lives in joomla.php or one of the other wonderful little scripts that come with J!.
I'll be following this thread.
I'll be following this thread.
http://www.jomres.net THE online hotel booking and reservation system for Joomla and Wordpress.
-
- Joomla! Apprentice
- Posts: 30
- Joined: Fri Aug 19, 2005 3:02 pm
- Location: Schwarzach i.V., Austria
- Contact:
Re: wysiwyg editor and patTemplate
Has anyone solved this problem? I also wanted to integrate the WYSIWYG-Editor into a pattemplate, but I didn't get it running.
- Vimes
- Joomla! Ace
- Posts: 1675
- Joined: Fri Aug 19, 2005 12:14 am
- Location: United Kingdom
- Contact:
Re: wysiwyg editor and patTemplate
Nope
http://www.jomres.net THE online hotel booking and reservation system for Joomla and Wordpress.
-
- Joomla! Enthusiast
- Posts: 166
- Joined: Thu Aug 18, 2005 11:45 am
Re: wysiwyg editor and patTemplate
Still no one who has a clue on what to do? It would be a real pity if this remains unsolved ......
Cheers
Ford
Cheers
Ford
-
- Joomla! Enthusiast
- Posts: 203
- Joined: Sat Aug 20, 2005 1:40 am
- Location: south of France
Re: wysiwyg editor and patTemplate
sorry, but i dont use wyg editors ...
- louis.landry
- Joomla! Ace
- Posts: 1380
- Joined: Wed Aug 17, 2005 11:03 pm
- Location: San Jose, California
- Contact:
Re: wysiwyg editor and patTemplate
I found some serious flaws in the way this is handled in the 1.0.x series when trying to use patTemplate. This is why i've changed the system to use a class called JEditor in 1.1
The main problem i ran into is that the editor functions echo code instead of returning it. By echoing the code to the output buffer they do not allow you to insert it into the patTemplate object. One way to get around this may be to capture the output using the php output buffer methods, though i haven't played with it.
Louis
The main problem i ran into is that the editor functions echo code instead of returning it. By echoing the code to the output buffer they do not allow you to insert it into the patTemplate object. One way to get around this may be to capture the output using the php output buffer methods, though i haven't played with it.
Louis
Joomla Platform Maintainer
A hacker does for love what others would not do for money.
A hacker does for love what others would not do for money.
-
- Joomla! Enthusiast
- Posts: 166
- Joined: Thu Aug 18, 2005 11:45 am
Re: wysiwyg editor and patTemplate
Okay, thanks for your reply. I'll have a look at this JEditor stuff.
Dang - it's a bit annoying since I was just getting familiar with patTemplate whilst rewriting my component. But patTemplate is still useful though and has some nice advantages.
Cheers
Ford
Dang - it's a bit annoying since I was just getting familiar with patTemplate whilst rewriting my component. But patTemplate is still useful though and has some nice advantages.
Cheers
Ford
-
- Joomla! Enthusiast
- Posts: 214
- Joined: Thu Aug 18, 2005 2:01 pm
- Contact:
Re: wysiwyg editor and patTemplate
Exactly! Until a core solution is decided or reached, another way to go around this problem is create a function for yourself/component to initialize the template and give you the correct code to push into patTemplate.webImagery wrote: The main problem i ran into is that the editor functions echo code instead of returning it. By echoing the code to the output buffer they do not allow you to insert it into the patTemplate object. ...
All you have to do is lift the code from the editor.php that initializes the editor bots and change the echo code to return. I have already done this (before stumbling upon this thread) on a component I was working on. And of course change a few variables to make sure I can initialize editors inside the logic codes to patTemplate.
If anyone is interested, just give this thread a bump or pm me and i'll post the little hack and implementation
"Speak your truth quietly and clearly; and listen to others; even the dull and ignorant, for they too have their story
...
If you compare yourself with others you may become vain or bitter, for always there will be greater and lesser person than yourself."
...
If you compare yourself with others you may become vain or bitter, for always there will be greater and lesser person than yourself."
-
- Joomla! Apprentice
- Posts: 11
- Joined: Sat Feb 04, 2006 12:30 am
- Location: Bordeaux, France
Re: wysiwyg editor and patTemplate
hi Audienceone !!
I think using pattemplates is a very good thing, because when html and php code are together, it's very ugly. Pat template is a very elegant way to do. But joomla is not yet prepared to it. There is too much echoooes functions.
But I am very interested about using wysiwyg editor with pattemplates.
could you show us the hack to do so?
because I can't find how to do with patTemplate without hack...
Thanks
(excuse me for my poor english!!! )
I think using pattemplates is a very good thing, because when html and php code are together, it's very ugly. Pat template is a very elegant way to do. But joomla is not yet prepared to it. There is too much echoooes functions.
But I am very interested about using wysiwyg editor with pattemplates.
could you show us the hack to do so?
because I can't find how to do with patTemplate without hack...
Thanks
(excuse me for my poor english!!! )
Signature rules: http://forum.joomla.org/index.php/topic,65.0.html
No images allowed.
No images allowed.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Wed Mar 01, 2006 9:35 pm
Re: wysiwyg editor and patTemplate
i am interestedtIf anyone is interested, just give this thread a bump or pm me and i'll post the little hack and implementation
runing j107 an ark_cornerdemo not getting any editor in the frontend to work
can anybody hep?
thx
Maik
-
- Joomla! Explorer
- Posts: 251
- Joined: Mon Sep 05, 2005 3:50 pm
Re: wysiwyg editor and patTemplate
This is the code I use to return an "HTMLEditor" string that I then add to the template as a variable.
It's just the existing editorArea() code but creates a string rather than echoing the results. It could probably be done more elegantly with output buffers, but I didn't try that.
david
Code: Select all
// Returns the editor area as a text string for inclusion in a template
function editorAreaText( $name, $content, $hiddenField, $width, $height, $col, $row ) {
global $mainframe, $_MAMBOTS, $my;
$ret = "";
// ensure editor-xtd bots are loaded only once
if (!defined( '_JOS_EDITORXTD_INCLUDED' )) {
define( '_JOS_EDITORXTD_INCLUDED', 1 );
$_MAMBOTS->loadBotGroup( 'editors-xtd' );
}
$mainframe->set( 'loadEditor', true );
$results = $_MAMBOTS->trigger( 'onEditorArea', array( $name, $content, $hiddenField, $width, $height, $col, $row ) );
foreach ($results as $result) {
if (trim($result)) {
$ret .= $result;
}
}
return $ret;
}
david
- Vimes
- Joomla! Ace
- Posts: 1675
- Joined: Fri Aug 19, 2005 12:14 am
- Location: United Kingdom
- Contact:
Re: wysiwyg editor and patTemplate
Looks like a fab idea, unfortunately $name isn't being seen and the text area is simply returning "". (Your mileage may vary).
Gonna haveta dig deepa, I think.
Edit: Strangely enough, when I call editorArea, the same thing happens, although other forms are fine.
Gonna haveta dig deepa, I think.
Edit: Strangely enough, when I call editorArea, the same thing happens, although other forms are fine.
Last edited by Vimes on Mon Apr 10, 2006 3:02 pm, edited 1 time in total.
http://www.jomres.net THE online hotel booking and reservation system for Joomla and Wordpress.
-
- Joomla! Enthusiast
- Posts: 220
- Joined: Fri Aug 19, 2005 12:28 pm
- Contact:
Re: wysiwyg editor and patTemplate
So, is there really no solution to this?
https://www.jreviews.com/joomla directory, classifieds, and reviews system for Joomla and WordPress
-
- Joomla! Enthusiast
- Posts: 220
- Joined: Fri Aug 19, 2005 12:28 pm
- Contact:
Re: wysiwyg editor and patTemplate
I will have to answer myself
I had tried several things, including the extended Php funtion for patTemplate that allows php code inside templates, but it did not always load the editor, especially in Firefox. To add to that, I really need to load the editor through xajax, and in that case it was not loading the editor at all. So I did some searching and found this page:
http://wiki.xajaxproject.org/Tips_and_Tricks:tinyMCE
and it works! At least it displays the editor, I have not tried submitting anything yet, but I thought I would share it here. I just have an empty div in patTemplate and send the editor to that div using xajax.
The only thing is that am not able to use the initEditor() to load the editor javascript. So right now I added this code to the template:
And then followed the example in the link above.
I will continue playing with it to see if I can use Joomla's built in editor functions to load the javascript.
I had tried several things, including the extended Php funtion for patTemplate that allows php code inside templates, but it did not always load the editor, especially in Firefox. To add to that, I really need to load the editor through xajax, and in that case it was not loading the editor at all. So I did some searching and found this page:
http://wiki.xajaxproject.org/Tips_and_Tricks:tinyMCE
and it works! At least it displays the editor, I have not tried submitting anything yet, but I thought I would share it here. I just have an empty div in patTemplate and send the editor to that div using xajax.
The only thing is that am not able to use the initEditor() to load the editor javascript. So right now I added this code to the template:
Code: Select all
<script type="text/javascript" src="{LIVE_SITE}/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
<script type="text/javascript">
tinyMCE.init({mode : "none"});
</script>
I will continue playing with it to see if I can use Joomla's built in editor functions to load the javascript.
https://www.jreviews.com/joomla directory, classifieds, and reviews system for Joomla and WordPress
-
- Joomla! Enthusiast
- Posts: 220
- Joined: Fri Aug 19, 2005 12:28 pm
- Contact:
Re: wysiwyg editor and patTemplate
Ok, I got as far as figuring out that:
$mainframe->set( 'loadEditor', true );
loads the editor javascript, but that's it, if anyone has more luck in getting this to work without having it tied to a single editor please post the solution here.
$mainframe->set( 'loadEditor', true );
loads the editor javascript, but that's it, if anyone has more luck in getting this to work without having it tied to a single editor please post the solution here.
https://www.jreviews.com/joomla directory, classifieds, and reviews system for Joomla and WordPress