Custom HTML Module - does not support joomla 3.0 - html

I am using advanced version of joomla, but facing problems when I am using custom html module or using HTML for articles too. The all attributes in HTML are replased by the / and "
Here's what is happening:
0. To start with, all the images were displaying as per the install just fine.
Copied the default module "Image Module", with a new name of "Image Module Me"
Set the menus so that the original module displays in the default menu, and the new one in my test menu
Somewhere along the line the images stoped displaying properly (showing a broken image link) for both the default Image Module and my copy.
When I look at the image module, I can see that the html has been changed.
Reset the html by reinserting the image, which generates the following html:
img src="images/headers/walden-pond.jpg"
note that the image appears just fine in the admin editor at this point
Save the module
Click on custom output - an lo and behold I've got a broken image link. When I check out the html I can see the following:
img src="\"images/headers/walden-pond.jpg\""
EDIT1 :
This is just because of Magic_quotes. How to disable magic quotes in joomla 3.0?

To disable magic quotes you have to edit the php.ini file in your server. In all honesty I'm surprised you could even install Joomla 3.0 as its a requirement for Joomla 3.0 that magic quotes is disabled. If you can edit the php.ini file you must add in:
; Magic quotes
;
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
You may need to contact your host to do this. In a last resort (and only in a last resort) edit your .htaccess file something along the lines of:
php_flag magic_quotes_gpc Off
etc.

Related

Formatting HTML with Nunjucks extension installed

I have some Angular component HTML some.component.html that I'm trying to format. When I hit ctrl-shiftp, and selectFormat Document` I get the message:
There is no document formatter for 'nunjucks'-files installed.
So it seems VSCode thinks that the .html file is a nunjucks file.
Is there a way to make it think that it's a html file?
You can switch back to HTML by clicking on the word "Nunjucks" in VS Code's status bar. This "Language Indicator" is near the bottom-right of VS Code's window. Clicking it will display a "Select Language Mode" drop-down-list where you can select "HTML".
After that, things that normally work for HTML files (like Format Document) will work again; however, things like the special syntax highlighting applied to Nunjuck files will not, but you can switch back and forth as needed.
Here's VS Code's documentation for Changing the language for the selected file.
Explicitly adding a "file.associations" in settings.json seems to solve the need to switch back-and-forth.
"files.associations": {
"*.html": "html",
}

Sublime text 2 Snippets - autocomplete

I've created a bunch of snippets in Sublime Text 2, but I cant remember them all off the top of my head. I've seen in a number of tutorials that as people start typing their snippets tab-triggers it will start to provide a list of the matching snippets. I don't see this.
Is there a setting somewhere for this? Or do I need to create a special file (completions file?). For most snippets I have the <scope> commented out as I may use in a PHP or HTML file for example depending what I am working on.
Most of my snippets tab triggers start the same elq- prefix, so it would be very helpful if it were to start showing me the options as I type.
The setting auto_complete_selector controls when Sublime automatically offers the popup for possible completions. The default value for this setting is:
// Controls what scopes auto complete will be triggered in
"auto_complete_selector": "source - comment",
This means that it will automatically pop up for any file that's considered a source code file, except within a comment.
The scopes for the file types that you mention in your question are text scopes and not source scopes, which stops the popup from appearing.
One way around that would be to manually invoke the auto complete panel by using the appropriate key binding, which by default is Alt+/ on Linux or Ctrl+Space on Windows/OSX. When you do that, the popup for possible completions at this point is manually displayed.
To allow this to work more automatically, you would need to modify the setting for auto_complete_selector to be more appropriate for your situation.
To do that you could select Preferences > Settings - User from the menu and add or modify the auto_complete_selector setting as follows:
"auto_complete_selector": "source - comment, text.html",
This says that the selector should always be displayed in source files except inside comments (like the default) and also within HTML files.
You could also use text instead of text.html if you want it to work in all text files of all types, although this would possibly get quite annoying while working with plain text files. Substitute an appropriate scope or set of scopes here as appropriate to dial in the places you want this to be automatically offered.

Custom code snippet for WebStorm and PhpStorm

I use custom code snippet for Sublime Text like custom comments, function, reusable block code, CDN and more.. but I could not do that in WebStorm and PhpStorm IDE.
Here is my building block code snippet (comments) for Sublime Text:
/*============================
comments
============================*/
and this code blocks for HTML5 comments
<!-----------------------
comments
----------------------->
Moreover I'm new user for JetBrains software. Can I use custom code snippet above in JetBrains software ?
It's called Live Templates in JetBrains IDEs.
Available at Settings/Preferences | Editor | Live Templates.
You can use existing Live Templates as is, alter them to your needs or create your own.
Creating own is better be done in own group -- they will be stored in separate config file so easier to share, no possible conflicts with built-in ones (easier to update between versions etc.). It also makes perfect sense to use separate group per language -- the same abbreviation can be used for different languages/context but abbreviation within the same group must be unique.
BTW -- I'd say -- do not edit built-ins at all -- just disable specific built-in template and create your own version of it in separate group. This way you can always see what fix/change devs have made in new IDE version etc.
Full official tutorial/how-to is available here: https://confluence.jetbrains.com/display/PhpStorm/Live+Templates+%28Snippets%29+in+PhpStorm
You may also be interested in other articles:
https://confluence.jetbrains.com/display/PhpStorm/Tutorials
in particular (since you have used Sublime in the past): https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+for+Users+of+Text+Editors
Finally I get a tips ! PhpStorm allows you to create your own live templates (code snippets) to optimise your workflows.
Open the settings dialog and head into Editor | Live Templates, you can see the available live templates grouped by language. To add a new template click the + (plus) button and select Live Template. Specify the abbreviation (the short bit of text you type that will be expanded to the full code snippet) and a description.
Then provide the full code snippet in the Template text field. You can include variables in the template in the format $<variable name>$, which will allow you to provide values when the template is expanded. PhpStorm recognises $END$ as a special variable indicating the final position of the cursor after the template has been expanded and values have been provided for all variables.
Next click the Define warning text to specify which language the template is for and optionally the context it is available in.
Now the template is ready to be used. Open a file and type the abbreviation that was specified earlier, then hit Tab to expand the template. The cursor will be positioned on the first variable, provide a value then hit Tab to keep moving through all available variables. The final position of the cursor will be the location of the $END$ variable.
Further Reading
Creating & Editing Live Templates
I don't think you can do this, however you can add custom tags in Settings > Editor > TODO.
//TODO & //FIXME are already implemented.
But this custom tags are not working for HTML.
Maybe you can find an extension to do that in Settings > Plugins.

Force autocomplete suggestions for file paths

I am currently working on a controller file for a Phalcon project. I like how PhpStorm gives you autocomplete suggestions when writing a src or href value in an HTML file. I was wondering, is possible to enable autocomplete suggestions when adding resources in a controller?
This is what happens when I force autocomplete suggestions(Ctrl + Space)
This is what I would like to happen.
EDIT: I should also note that I have marked the folder, containing all my resources(ie. CSS, javascript, and images), as the "Resource root".
RE: EDITThis does not affect availability of this feature/functionality in any way as "Resource roots" are used for path resolutions/validation and not for actual "offer this functionality or hide it" choice. -LazyOne
Unfortunately there is no real way of automatically providing such functionality in random string as it's hard to guess that file path is expected in this particular place (function parameters is different case -- here some hinting mechanics (special annotation) may work).
But .. you can forcibly enable it manually for each particular place (should last until file or project is closed):
Have some code, e.g. $someVar = ['css' => 'aaa'];
Place caret inside aaa string (it has to be 3 or more characters, based on my observations, otherwise option in #4 will not be present -- must be some sort of optimisation/limitation from IDE side)
Invoke shortcut to bring "Quick Fix" menu (Alt + Enter on Windows)
Choose Inject language or reference from appeared menu
Choose File Reference from next menu
Start using it (Ctrl + Space)
EDIT: I should also note that I have marked the folder, containing all my resources(ie. CSS, javascript, and images), as the "Resource root".
This does not affect availability of this feature/functionality in any way as "Resource roots" are used for path resolutions/validation and not for actual "offer this functionality or hide it" choice.

How do I include an svg image in exported html file using emacs org-mode?

I've tried the following syntax:
[[folder/figure.svg]]
along with org-export-as-html.
This apparently does not work - just adds a reference ... in the html file.
I had to test this a couple times to clarify exactly what the issue appeared to be. The image exports successfully when I use the following link:
Current folder is ~/test/
[[./img/Bitmap.svg]]
[[./Bitmap.svg]]
[[~/test/Bitmap.svg]]
However it fails with:
Current folder is ~/test/
[[img/Bitmap.svg]]
[[Bitmap.svg]]
I suspect it is that Org has to find where on the path the image is, the ./ tells it to look from current location, while ~/ can be properly expanded by the shell to give the current directory.
If you prefix ./ to your images they should export correctly.
In Org mode, the org-export-html-inline-image-extensions variable determines which image files get inlined and not linked in the html output. You should also check the settings of the org-export-html-inline-images variable, in case also other types of images do not get inlined.
To customize these options, you can
M-x customize-option org-export-html-inline-image-extensions
or use the menu 'Options > Customize Emacs > Specific Option' in case you have a GUI available.