I have an custom module for search location.Now i want to put this module in to one of menu item content page. I am using joomla 2.5. Any way how to do it?
I have solve it by use the {loadposition} method
For using the module into your content page go to extension manager->plugin manager.Then search for Content - Load Modules plugin enable it(if disable). Then set style to no wrapping(raw output).
and then to your article manager and insert this line where you want to display your module
{loadposition myposition} //where myposition is the position of your module
Related
I am having a problem with WebStorm auto complete when using import keyword in JavaScript.
You can see an example here: https://i.gyazo.com/95adbf84c964663f715fc069ba1e1e8a.mp4
Basically when I auto complete following code:
import {loadLevel, loadSprite} from './loaders';
It doesn't add a file extension to loaders, which should look like this:
import {loadLevel, loadSprite} from './loaders.js';
I am using latest WebStorm version, I also tried to Invalidate cache and restarted IDE.
I am using JavaScript ES6 version in settings.
There are no other files called loaders with different extension anywhere else in my project.
If you need any more info, let me know.
Thanks
WebStorm supports completing file name with extension (when using completion in the from part). To enable completing file name with extension, set registry key commonjs.complete.required.filename.with.extension to true :
Open Help | Find Action... dialog
Type Registry, find Registry item in dropdown list and press Enter
Find commonjs.complete.required.filename.with.extension there, tick the checkbox
But this hidden option doesn't affect auto-imports, so, when auto-creating import statement from reference, extension won't be added - WEB-28741
I need to manipulate a content type (people) before being saved from ADMIN.
I need to save the name + surname in the title
I know the presave functions (hook_node_presave or hook_entity_presave) should be used.
My problem is where should these functions be written?
I am writing them in themes / custom / MYPROJECT / MYPROJECT.theme but they do not run
Where are the preset functions written for ADMIN to use instead of the normal ones?
You can put your hook in a .module file of a module. You should create a custom module for this, example below:
in modules/custom create a new folder {PROJECT_NAME}_general now referred to as MODULE_NAME) and add 2 files: {MODULE_NAME}.info.yml and {MODULE_NAME}.module
In the .info.yml file you just put some information regarding your custom module, for example:
name: Name of your module
type: module
description: Description of your custom module
core: 8.x
package: Custom
Now you can enable your module using either drush (drush en MODULE_NAME -y) or using "extend" from the admin menu.
Finally add your hook to the .module file and write the desired code.
You can also find all of this information here and here
Hope this helps you out!
Currently, all my angular material HTML attributes are highlighted in yellow with WebStorm 9 (Mac OS X Yosemite) warning: "Attribute [name] is not allowed here".
How can I teach WS to automatically recognize these attributes as valid? I am aware that I can add each one one-by-one to the list of custom attributes, but was hoping that there would be a better way to do this.
UPDATE:
Just wanted to clarify that this issue applies to Angular Material project, and not the AngularJS itself.
You need to add the angular-material.js file as a Library in WebStorm:
Open Preferences (Mac: Cmd+,, Win/Linux: Ctrl+Alt+S)
Go to Languages & Frameworks > JavaScript > Libraries
Click Add and then press the + icon
Find angular-material.js in your node_modules folder
Add a Name and a version and press Ok
Now you will have completions for all elements and attributes that have an #ngdoc documentation in the angular-material source code.
Usage
Start typing and you will see the completions:
Pressing F1 (Ctrl+Q on Win/Linux) will also show some docs, if available in the source code:
Important note
Not all features are properly documented, the following won't show up (unless you already used them) cause they are defined dynamically in a loop, with no #ngdoc for them:
var API_WITH_VALUES = [ "layout", "flex", "flex-order", "flex-offset", "layout-align" ];
var API_NO_VALUES = [ "show", "hide", "layout-padding", "layout-margin" ];
So for these you'd have to add them as a custom attribute (Alt+Enter > "Add flex to custom html attributes").
Environment
Tested on a Mac OS X 10.11.4 using WebStorm 2016.1.1, but this should work for older versions as well.
I am using PHPStorm, which is a sister Project of WebStorm, but it should work the same way.
You maybe need to add the Library:
File
Settings
Languages & Frameworks
Javascript
Librarys
Add here AngularJS
If this does not work, you can add them manually:
Follow this Steps:
File
Default Settings
Editor
Inspection
HTML
Unknown HTML tag attributes
To the right you will see in Options "Custom HTML tag attributes". Enter here the attributes you want to allow.
I highly recomend you to install the Angular.js plugin:
Go to menu File > Settings (or ctrl + alt + S if you're on Windows);
Select Plugins in the window that'll open;
Click in the Browse Repositories button;
Type AngularJS in the search field. Select the plugin;
Click Install Plugin.
The plugin is incumbed to read #ngdoc annotations present in ngMaterial sources and create documentation for their directives.
It seems to support WebStorm and other IDEs, but I could not find it in the plugin registry while filtering by other IDEs. Maybe it'll work inside WebStorm...
Anyway, this is what you get:
You have also a plugin that helps a lot, check it out. It helps a lot
Angular material v2, Teradata covalent v1, Angular flex layout v1 & Material icon live templates
And with the solution provided by #Alex Ilyaev gives a lot of help.
But its no perfect.
Hope it helps.
Currently I don't think that idea's AngularJS plugin understands angular-materials attribute extensions.
It does understand the directives i.e. control click <md-button ...> and the directive (custom tag) is found.
For now you will have to add the attributes af custom attributes in order to get a "green" page.
Using django-cms 2.4 I need to create pages that contain bootstrap code, but the html5lib used cleans data-* attributes. No matter if you specify valid_element in TINYMCE_DEFAULT_CONFIG. (I still looking for a similar option for Wymeditor), because this is done in #plugins/text/models (clean_html function: https://github.com/divio/django-cms/issues/1529 )
Github issue:
https://github.com/divio/django-cms/issues/1529
What could it be a possible workaround?
How can I extend the text plugin in the admin part?
Thanks!
i belive the removing of the fields is done by html5lib that the cms uses as python package, you'll need to open html5lib folder and open sanitizer.py, in line 184 where the code is:
if name in self.allowed_attributes])
change to:
if name in self.allowed_attributes or re.match( r'data-.*',name)])
this will allow all data-(whatever) attributes
for WYMeditor the data-(whatever) attribute is already allowed
I am developing a Magento extension and would like to run some jQuery script in the footer of the html template.
I have manually edited page.xml layout file to load my jQuery source and manually edited the footer.phtml template file to test my code, but I now want to package it up into an extension. The question is how to do this within my extension configuration, to tell magento to load the new jQuery source library in the header, and to append code somewhere in the footer (or anywhere) in the magento generated theme html.
Create a custom Magento Module
Use this module to add a customer Package Layout Update XML File
Use this Package Layout Update XML files to add a javascript src link to a (CDN?) jQuery, and add a custom block to the before_body_end block
Use this custom block to output your needed Javascript code
Use Magento Connect System->Magento Connect->Package Extensions to package up your customer Magento Module file, as well as any other files on the system you used (phtml template, jQuery files if not using a CDN, etc) into an Extension.
Wouldn't it be easier to use a static block? This way the client or yourself could update the jQuery right in the admin area without going into code. You could also add logic with multiple blocks if you needed. You can display a static block in a template like so:
<?php echo $this->getChildHtml('staticblockname') ?>
Otherwise you might want to read this tutorial on creating a module (which you call an extension): http://magento4u.wordpress.com/2009/06/08/create-new-module-helloworld-in-magento/