I've pushed an update to the develop branch where you can set the "preview" => FALSE. In addition, you can fix the rendering by specifying a different view file also using the "preview" parameter. The following example would look for a file in the fuel/application/views/fuel_preview: .... 'preview' => 'fuel_preview'... Alternatively, you can change the code in the fuel/application/views/_admin/_fuel_preview.php file.
Actually if it could, I hope there is a preview button beside save which could preview whole form input instead of previewing text area input only Could u point me a direction, maybe I could try to write this as plugin to further my understanding of fuel cms. I believe this will be useful
That sounds like the "preview_path" parameter for your module. If you set that, a "View" button will appear. The "preview_path" should be the URI path to the page and include placeholders for form values like: ...
'preview_path' => 'news/{slug}'
...
Hi! I want to make preview for some textareas with different styles, unfortunately option
.. 'preview' => 'fuel_preview' ..
does nothing, it still uses preview file in views/_admin/_fuel_preview.php, I tried to set different options (even empty value or not existing file) but it doesn't change a thing... (version 1.2.1)
It's not really stated in the documentation but the view file should be in the views/_admin/ folder. If you look at the fuel/modules/fuel/controllers/preview.php file, you'll see the logic of how it determines which view to use. Additionally, the variables 'module' and field are passed to the view file so it's possible to use a single view file with conditional logic to output different things based on those values.
It would be handy to have the 'source'=>false option too to hide the "source" button (in my CKEditor implementations, I use the built-in source edit feature)
Comments
Go to \fuel\modules\fuel\assets\js\fuel\custom_fields.js
There's a method called createPreview. You'll see the following around line 318 (I'm using v1.1).
var createPreview = function(id){ var $textarea = $('#' + id); var previewButton = '<a href="#" ....
Set 'previewButton' to be null in the code above, and it'll not be displayed.
Edit: Alternatively, there's a CSS solution.
In file \fuel\modules\fuel\assets\css\fuel.min.css, you'll see minified CSS that's used in the CMS.
On the second line add the following:
a.editor_preview { display: none; }
.... 'preview' => 'fuel_preview'...
Alternatively, you can change the code in the fuel/application/views/_admin/_fuel_preview.php file.
... 'preview_path' => 'news/{slug}' ...
I want to make preview for some textareas with different styles, unfortunately option
.. 'preview' => 'fuel_preview' ..
does nothing, it still uses preview file in views/_admin/_fuel_preview.php,
I tried to set different options (even empty value or not existing file) but it doesn't change a thing...
(version 1.2.1)
It would be handy to have the 'source'=>false option too to hide the "source" button (in my CKEditor implementations, I use the built-in source edit feature)