Sylius e-commerce issue with applying CK Editor - symfony

I would be very thankful if somebody might help me with some stuffs about CKEditor on symfony ( sylius e-commerce project ).
Things I want to do are:
I am wondering how I could replace standard textarea on my sylius admin dashboard panel with ckeditor textarea? For example
I want to replace that standard textarea with advanced text area using ck editor..
so if somebody might help me I would be really thankful.

I solved this on next way :
1) EDIT FILE "StaticContetType.php", find a textarea and edit it on a this way:
->add('body', CKEditorType::class, [
'required' => false,
'label' => 'sylius.form.static_content.body',
])
and u get rich ckeditor textarea instead of that simple one =)

just insert this in your backend layout view..
<script src="//cdn.ckeditor.com/4.5.10/standard/ckeditor.js"></script>
<script>
$('textarea').each(function() {
CKEDITOR.replace($(this).attr('id'));
})
</script>

Related

Add contextual link to a view block

I would like to add a link to the contextual links on a view block. Currently there's the "modify view" and "translate view" links.
Isn't there a way to inject it in the myTheme.theme file ? Like a preprocess ? I looked in the preprocess_view_view and there's only this in the title_suffix :
"contextual_links" =>
"#type" => "contextual_links_placeholder"
"#id" => "entity.view.edit_form:view=promotions:location=block&name=promotions&display_id=block_1&langcode=fr"
I want to add "Sort" that links to "/admin/sort/promotions".
I searched a bit and all I see is solutions talking about creating a custom module. I tried but it's way over my head with the routing and all... I just don't get it. Seems I would need to learn Drupal 8 inside out just to add that link.

Button links not redirecting prospect theme wordpress

I recently installed prospect theme and i am having tons of trouble as most things aren't customizable directly from the options interface. You can see a demo here:
http://themes.wpbusinessbundle.com/prospect/
So i'm trying to add buttons, which when i add them look fine, but don't redirect anywhere (redirects to the same page with #). I know it's because of something missing that needs to ''pull'' the link I include in the html when i write/insert the button but can't figure out where to modify it in the css or how.
Any help is appreciated. Btw, Calls to action work but I cannot change their color or their size so that's not much good.
From observation of the PHP, the shortcode for a button should be arranged to match:
"extract(shortcode_atts(array(
'link' => '#',
'target' => '',
'variation' => '',
'size' => '',
'align' ...."
What this means is the button shortcode that the visual editor makes will have to be manually edited to look something like this for example:
[button link="http://google.com" variation="blue" size="large"] TEST [/button]
I'm using the theme myself and I've had to edit a lot of the.. questionable code ;P.
Hope this helps.

How to use tinyMCE into sonata admin bundle

I want for all my entity properties type "text" to show a html editor(preferably tinyMCE) in the forms to create and edit.
Is there any way to do it?
I'm not sure if the text input is the best way (and possible) to represent your text editor over the textarea element using TinyMCE. Here it goes how you do it:
->add('myText', 'textarea', array('attr' => array('class' => 'tinymce', 'tinymce'=>'{"theme":"simple"}')));
You can later include TinyMCE dependencies by adding a custom template for this field with its template option (although it would be recommended to add them inside the <head> of the page)
hi first install tinycme editor bundle in your project for this please see this page
after that for using in sonata admin see this issue

Drupal 6: Implement Wysiwyg on Custom Module Form

I have a custom form that I have written with the Form API. We have the WYSIWYG module and TinyMCE implemented on the site that this module will be used on. How do I implement the WYSIWYG api on my custom form text areas?
Thanks!
This should help integrate WYSIWYG with your custom module forms: http://drupal.org/node/358316
Basically, you need to add the format key to each of your form fields and use filter_form()
Just in case anybody working with Drupal 7, here's the link to it that should help integrate WYSIWYG TinyMCE with your custom form fields: http://drupal.org/node/1087468
Thanks
In case you are working in drupal 7. Use the following.
$form['FIELD'] = array(
'#type' => 'text_format',
'#title' => t('TITLE'),
'#format' => 'full_html' //the format you used for editor.
);
In your form submit handler, you can access the value as follows.
$form_state['values']['FIELD']['value'];

How to use Wordpress Text Editor in a custom plugin

How can we use default wordpress text editor for my wordpress plugin.Any suggections please?
The WordPress Text editor is an application of the TinyMCE Editor. You can utilize the files located in wp_includes/js/tinymce and create an instance of the editor on your own, according to the documentation.
Check out this article for example instructions:
http://wordpress.org/support/topic/how-i-can-use-tinymce-for-my-own-plugin
As of Wordpress 3.3 the_editor has deprecated in favor of wp_editor. wp_editor uses the new media uploader and takes advantage of all the new features of Wordpress 3.5.x Documentation here: http://codex.wordpress.org/Function_Reference/wp_editor
A very good example of how to use it can be found at Wptuts+ here: http://wp.tutsplus.com/articles/tips-articles/quick-tip-using-wp_editor/
very easy try this code
it's working
wp_editor( $distribution, 'distribution', array( 'theme_advanced_buttons1' => 'bold, italic, ul, pH, pH_min', "media_buttons" => true, "textarea_rows" => 8, "tabindex" => 4 ) );
Very easy:
<?php wp_editor( $content, $editor_id ); ?>
This will generate a lot of html tags. But the one you will be interested in is the textarea with its name set to $editor_id. So when the form is submitted, you can save that content.
You can find more info here: https://codex.wordpress.org/Function_Reference/wp_editor

Resources