Single Page Editor - Loading File Selector + TinyMCE without top toolbar
Permalink
Hello,
I'm building a front-end single page editor to allow registered users to edit their own pages/attributes (based off of Andrew's How-tohttp://www.concrete5.org/documentation/how-tos/developers/build-a-s...
I've moved the single page out of the dashboard, so it's a page that registered users can access from the front-end. These users will not have access to the top tool bar for edit/dashboard. There is a file selector, as well as a rich-text box. This works fine if I'm logged in as admin (with the top C5 toolbar), but does not work if logged in as just a registered user (without C5 toolbar). The file selector just shows a loading wheel, and the rich-text box only shows a standard text box (no text editing tools, this is because the file selector is throwing a js error: Uncaught ReferenceError: ccm_triggerSelectedFile is not defined. If I comment out the file selector, TinyMCE works fine).
What helpers do I need to load in the single page controller to enable these to work? I want the users to be able to choose a file from the file manager. Please see the attached screenshots.
I've tried adding the following to the page controller's view function, but it still doesn't work as a registered user:
Controller:
View:
Thank you for any help in advance!
I'm building a front-end single page editor to allow registered users to edit their own pages/attributes (based off of Andrew's How-tohttp://www.concrete5.org/documentation/how-tos/developers/build-a-s...
I've moved the single page out of the dashboard, so it's a page that registered users can access from the front-end. These users will not have access to the top tool bar for edit/dashboard. There is a file selector, as well as a rich-text box. This works fine if I'm logged in as admin (with the top C5 toolbar), but does not work if logged in as just a registered user (without C5 toolbar). The file selector just shows a loading wheel, and the rich-text box only shows a standard text box (no text editing tools, this is because the file selector is throwing a js error: Uncaught ReferenceError: ccm_triggerSelectedFile is not defined. If I comment out the file selector, TinyMCE works fine).
What helpers do I need to load in the single page controller to enable these to work? I want the users to be able to choose a file from the file manager. Please see the attached screenshots.
I've tried adding the following to the page controller's view function, but it still doesn't work as a registered user:
Controller:
$html = Loader::helper('html'); $this->addHeaderItem($html->css('jquery.ui.css')); $this->addHeaderItem($html->css('ccm.dialog.css')); $this->addHeaderItem($html->javascript('jquery.ui.js')); $this->addHeaderItem($html->javascript('ccm.dialog.js')); $this->addHeaderItem($html->javascript('tiny_mce/tiny_mce.js'));
View:
$al = Loader::helper('concrete/asset_library'); $mPageSiteBanner = $faq->getAttribute('site_banner',$ctID); echo $al->image('mPageSiteBanner', 'mPageSiteBanner', 'Choose Site Banner', $mPageSiteBanner);
Thank you for any help in advance!