Using different editors for blocks and pages
I am using blocks to define various sections so that only requires text-box (markitup)
but pages need wysiwyg (ckeditor)
I know that fuel/application/config/MY_fuel.php defines the global config for this.
Can I have my own control over which module displays which type of editor? how?
Comments
I am using CMS database to store blocks and pages. When saving references to images, javascripts etc
/assets/js/script.js //or /assets/assets/logo.png //the editor converts it to {js_path('scripts.js')} //or {image_path('/assets/logo.png')} // why would this not show the image?
but i think this is breaking the views when logo.png is not found in path. What are best practices when saving image/scripts references within the editors? I am using fuel v1.0.4
and there is a typo in http://docs.getfuelcms.com/general/template-parsing
the heading says "Temlate Parsing"
for example something like:
<p> {include_widget('calendar')} </p>
{fuel_block('calendar')} {fuel_block('calendar', array(key="val",...))}
http://docs.getfuelcms.com/general/forms#wysiwyg
Regarding the image_path function, it's actually, img_path():
<img src="{img_path('/assets/logo.png')}" alt="">
Thanks for the heads up on the typo. That should be fixed now.
But the img_path function once saved in database, is being published as is without plugging in the image path.
//getting this error <h1>An Error Was Encountered</h1> <p>Compilation error at line 13 in "string:" : Parse error in "logo.png)}" /> //AND as you can see here the path was not translated <img alt="Image" src="{img_path(/assets/slide-3.png)}" />
public $parsed_fields = array('content', 'content_formatted');
In the example, this says to parse the record property of "content" and the magic property "content_formatted"
If you are talking about strictly parsing a block, you can pass the "parse" parameter like so:
{fuel_block(array(view = "calendar", parse = true))}
Note that the above syntax is using an array to pass parameters which is necessary since you are passing more then just the view to load for the block.
but I am saving the body content in fuel's pages module. In ckeditor when referencing FQPN /assets/assets/logo.png or /assets/images/image.png or /assets/js/script.js and when saved it replaces it to {img_path('/assets/logo.png')} OR {img_path('/logo.png')} OR {js_path('/js/scripts.js')}
then it shows up the same way on front-end with img_path parts intact...
BTW... img_path starts at the assets/images folder so you'll want something like {img_path('logo.png')}. Similarly, javascript starts at the assets/js folder {js_path('scripts.js')}
// actual excerpt of content html saved in database by ckeditor for path i gave was /assets/images/logo.png <img alt="" height="34" src="{img_path(/logo.png)}" /> // actual output view source <div id="error_general"> <h1>An Error Was Encountered</h1> <p>Compilation error at line 13 in "string:" : Parse error in "logo.png)}" /> </a></h1>
btw if i remove the slash and save {img_path(logo.png)} the error goes away.
When and If i give the FQPN /assets/images/logo.png
The ckeditor parses it and plugs in img_path but the slash remains (i.e. {img_path(/logo.png)} ) that breaks the front end parser.