JCE does not support RAW document ?

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
Quark Zimmerman
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sun May 27, 2018 7:58 pm

JCE does not support RAW document ?

Post by Quark Zimmerman » Sat Aug 11, 2018 11:01 am

Problem goes like this:
I created a view with edit layout containing JCE in Form.
All works fine as separate page.
But once I wanted to load this page as RAW inside another Joomla component page (basically adding &format=raw to link) I am starting to get the following error:
Fatal error: Call to undefined method JDocumentRaw::addCustomTag() in C:\wamp64\www\Maxima\libraries\joomla\html\editor.php on line 258
Checked and debugged the code and indeed , when I call "$this->form->getInput('authorBioEditor')" in my code , it goes into Editor's (JCE) display() function and there , inside initialize() function calls

Code: Select all

		$document = JFactory::getDocument();
		$document->addCustomTag($return);
Since it's a framework code and the document IS JDocumentRaw as I intended (as I said I want to embed one view into another, which I was doing often and successfully so far) it looks like JCE editor does not support being embedded into RAW format views ?
Is this correct and is there a way to work around it ?

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2906
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: JCE does not support RAW document ?

Post by SharkyKZ » Sat Aug 11, 2018 11:37 am

How are you inserting one view into another and why?

Quark Zimmerman
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sun May 27, 2018 7:58 pm

Re: JCE does not support RAW document ?

Post by Quark Zimmerman » Sat Aug 11, 2018 12:03 pm

Well I insert simply by requesting page in "raw" format by JQuery post() and then inserting the query result into a a "placeholder" div HTML element.
As for "why" , that's quite simple , most of the time user does not need this editing features, so no need wasting server resources generating it on each page, only when user press "Edit" button or something , or opens collapsible element I request the content and render it as above.
Also its very helpful in keeping the code modular , I can work on specific view and then it get's updated in all views using it.

In the example above I have a authors biography displayed on author's page (view) among with all the data, the biography is a "default" view layout and injected when user clicks on "Biography" collapsible slider button, then if user wants to edit biography he press "edit" icon there and the content get replaced with "edit" layout.

This works quite well in most cases when I needed to edit one string, enter number or upload the image file, however when I needed to edit a lot of text and used JCE in form , I hit this problem with raw format.

Anyway, isn't that's what "raw" format intended for ? - to be able to generate page without actual header, footer ,tags and other stuff.


Locked

Return to “General Questions/New to Joomla! 2.5”