Custom style format in tinymce editor - override in theme? - impresspages

This is a follow up question to this:
Adding custom style format to tinymce editor
#Mangirdas Skripka or other Impresspages people:
In the answer to the above question: Are you suggesting to make an own version (widget/plugin) of the tinymce plugin or can I just override tinymce's default.js in my own mytheme/override folder?
Putting edited versions of default.js and Event.php in my theme's override folder does not work, not with any of these locations:
test 1: mytheme/override/Ip/Internal/Core/assets/tinymce/default.js and mytheme/override/Ip/Internal/Core/Level.php
test 2: mytheme/override/assets/tinymce/default.js and mytheme/override/Level.php
Can the standard text-plugin (tinymce) be overriden or do I need to make a new plugin/widget?
Thanks for your help!

Override folder is just for view files. JavaScript or other PHP files can't be overriden in override folder.
And dues to JavaScript nature you don't need files to be overriden. JavaScript allows you to override anything at any time. You better go by duplicating one of the existing plugins and adding your own rules.

Related

Override template

I am looking to create a module for a customer, but I have to override the product_variants.tpl from the prestashop classic theme.
I have two questions:
Is there any way to override it without edit the original file? Should I need to create a copy of the entire theme or is there a cleanest solution?
If I will override that file and my customer would like to change the classic theme with another one, I have to change the override again because the file will probably have another name and not 'product_variants.tpl', right? Is there a modular way to do this?
Thanks in advance!
There is no officially way to override the core template files of the theme from module. The best way is to create a child theme, and override only the files you need.
https://devdocs.prestashop.com/1.7/themes/reference/template-inheritance/parent-child-feature/
The answer to the second question is yes. And it works correctly, because each theme has its own structure, and it's possible that the modifications you've made to the old theme might cause the new theme to not work properly.

ExtJS 5 Custom Theme Testing

I recently started to create custom theme for ExtJS 5 by Sencha.
Following http://docs.sencha.com/extjs/5.0.0/core_concepts/theming.html I managed to create ThemeDemoApp, inherit ext-theme-neptune, change $base-color to green and refresh/rebuild ThemeDemoApp with my-custom-theme. All ok.
My problem is, ThemeDemoApp is quite poor for testing a custom theme. A panel, tab, button and a modal window. That's it?
After bit of googling I bumped into http://dev.sencha.com/ext/5.0.0/examples/themes/index.html. (Why isn't this mentioned in the guide?!) Heading says: View and test every Ext component against bundled Ext Themes, or your own custom themes.
My question is: How? How do I test my own custom theme against this example? Do I have to dig into the source (themes.js) and build such page/application myself?
The examples - including the Theme tester - is included in the ExtJS download.
You can modify the list of themes available by editing the shared/options-toolbar.js file.
To get it to find your theme, you'll either need to name it similar to the others (ext-theme-name), or modify themes.js accordingly.
Or you could just hack the theme.js file to hardcode your theme.
(Ext JS 4 used to create an example page for themes automatically - it doesn't seem to do that now, though)
According to advice at How do I include a JavaScript file in another JavaScript file? I decided to load both options-toolbar.js and themes.js (with just minor modification - commenting out Ext.onReady(...) function in themes.js) and I used functions getBasicPanel(), getCollapsedPanel(), etc. in my own application to create the same testing page (absolute-layout container that fits the page).
Anyhow, I guess Robert's answer is the correct one - there is no prearranged, ready-to-use functionality from Sencha :-(

Sylius theming and multilanguage

im new to sylius and wanted to know does sylius have theming and multilanguage? I cant find multilanguage option anywhere only language selection. And themes should be awesome feature still cant find that. Thank for reply.
Now Sylius is having theming facilities:
http://docs.sylius.org/en/latest/bundles/SyliusThemeBundle/index.html
Short explanation:
Themes reside in the 'app/themes/' folder (you can have multiple folders with different themes). The only required part for setting the theme is a composer file within the folder (each respective folders) and just add the name parameter. eg.
{
"name": "theme-name"
}
for having a grouping of themes you can also have the name like 'group-name/theme-name'.
You need to activate your theme in your config file. For that, just add
sylius_theme:
sources:
filesystem: ~
Now when you are in the administrative panel at the backend, you can select this theme from the dropdown list while customising a 'Channel'.
You can also override any bundle and customise it. For details please check the documentation.
As of version 0.13 it now is fully i18n. You can even add translatable entities using the ResourceBundle.

Yii - Using alternate view file in Yii User module

Is it possible to use a custom view file in a module (eg. user) in order to keep the module (3rd party) intact?
Somehow extend the module, with a views folder that holds my custom views.
The path to the module theme views should be
/{{your_app_name}}/themes/{{theme_name}}/views/user/
Copy all of the module views from the folder
/{{your_app_name}}/protected/modules/user/views
to the mentioned above folder and that will do the job. After that you could customize the views as you like.
Copy user module view files to <app>/themes/<current_theme>/views/user/. More general, customize module views using the folowing "formula": <app>/themes/<current_tehem>/views/<modules_name>/<controller_name>/<view_file_to_customize>.php
Use a theme. For a module named "user" and a view path of "profile/edit", create "/themes/flashy/user/views/profile/edit.php". You can also define a new layout in "/themes/flashy/layouts/column2.php". Then add to your configuration file in "protected/config":
return array(
// many settings...
'theme' => 'flashy',
For the module "user" you pointed out, unfortunately its controllers use absolute paths for their layouts (e.g. "//layouts/columns2") so AFAIK you can't define distinct layouts for the application and this module.
See also the official guide chapter on theming with Yii.
I disagree that in many help forums of the Internet, when someone asks abot theming a module, everyone suggests a path alias to the themes folder. I think this is wrong, because it implies modules to be splitted, and modules are supposed to be a black-box that can be used across projects. The advice given in such forums would only be valid if a theme is shared among several modules. If someone wants to "package" a theme inside a module, she can:
-add an init function to the controller of the module
-inside that init, use the class attribute layout and a path alias, like this, supose a module whose id is "Sample":
then you add, to SampleCOntroller.php:
public function init() {
//BELOW: it will use the layouts/main.php inside the module.
$this->layouts = "sample.views.layouts.main";
}

Where should I put my custom widget files in Yii framework?

From this page,
http://www.yiiframework.com/wiki/23/how-to-create-a-breadcrumb-widget/
It seems it suggests that we should put the files in the component folder. But if my widget contains javascript and css files, where should these files be placed?
By the way, is this a good idea that I create it as an extension? If I go this way, all widget files are more self-contained in a folder inside the extension folder. But since the widget I am going to work on is very customized, it's unlikely that it will be useful to other people or my other projects. Making it an extension seems a little bit strange.
I understand that it does not really matter where I put these files as long as the paths I am using in the codes are correct but I would like to know the common practice.
I think the common practice is to put the widget in extensions folder with js & css files in an folder named asset. In the php class file, you do initialization first by publishing the asset with yii asset manager.
The file structure may be like
extensions/
widget_name/
widget.class.php
assets/
plugin.js
style.css
I would join the recommendation to put the widget under /protected/extensions.
I put the assets in a slightly more detailed manner: /protected/extensions/WidgetClassName/assets/ and the widget view files in /protected/extensions/WidgetClassName/views/...
Don't forget to edit your /protected/config/main.php and add a row in the 'import' section (for autoloading of the widget): 'ext.WidgetClassName.WidgetClassName.*'