MediaWiki: an imported template returns many errors - mediawiki

I've installed a mediawiki and imported an example page from Wikipedia. But the template is not shown properly. https://wordpress-251650-782015.cloudwaysapps.com/wiki/Cheeta
Any hint on what could be the cause?

You're most likely missing one or more required templates/Lua modules this template relies on. If you want to get all the required templates/modules you can get them via https://en.wikipedia.org/wiki/Special:Export by inserting the template name and ticking the box saying Include templates, and then importing the file generated from that via http://wordpress-251650-782015.cloudwaysapps.com/wiki/Speciale:Importa. However in most cases, except if you desperately want the exact look and feel its easier to write your one template, because Wikipedia templates get enormously complex

Related

Mediawiki dumpBackup parameters

I fail to understand some options in the dumpBackup.php maintenance script of Mediawiki.
What is the effect of --include-files? In my test wiki, dumpBackup.php --current --include-files and dumpBackup.php --current both contain the pages of the File: namespace and I see no difference.
What is the effect of --uploads? In my test wiki I see that the xml file contains a tiny bit more of xml but, to me, it looks like this is all information which is there already as part of the File: page. What is the use of this flag?
When I add both --include-files and --uploads I get the next surprise. I actually expected the combined effect of both options, but what I get is the file content of the uploaded files and the upload record. Why did I not get the file contents when I used --include-files alone?
When I use only --include-files and --uploads but no --current I would have expected to get the content of the uploaded files and the upload record (and none of the other pages). However ,I get the warning no valid action specified and no further information at all
I am completely confused since I do not understand the logic behind all of this.

PhpStorm - extend PHP Class template

I'm trying PhpStorm. I like the File Templates functionality and I'd like to use it in some more specific cases.
I'd like to extend to PHP Class template to create a new template that I'll be using for a specific type of classes. If I just duplicate the template, it doesn't really work as I'd expect. For example, while when I use PHP Class, the namespace is already compiled, this does not happen with my new template.
Is it possible to create another template so that it works as PHP Class?
Moreover... is there a way to order the templates in the editor, so I could have my new template near all the other PHP templates?
Is it possible to create another template so that it works as PHP Class?
Unfortunately not; at least not in current versions (2016.2).
When you are using New | PHP Class you see special dialog box that works with 3 templates (depends on what you will be creating: Class, Interface or Trait). This dialog uses file templates with predefined (default) names only and you can customize them as you wish .. but all other file templates for .php files will be just ordinary File Templates without those extras.
Based on your requirements you might be interested in https://youtrack.jetbrains.com/issue/WI-21711 ticket -- watch it (star/vote/comment) to get notified on any progress.
Please note that file templates could be project-specific (different template content for each project) -- this might be enough in some (rather simple) cases.
Moreover... is there a way to order the templates in the editor, so I could have my new template near all the other PHP templates?
Unfortunately not -- no sorting/subfolders is available (although you may have project-specific file templates).
Right now I may only suggest to use some common prefix in template name and build your sorting order around this idea.
Other than that -- https://youtrack.jetbrains.com/issue/IDEA-75239 + https://youtrack.jetbrains.com/issue/IDEABKL-3599 -- watch these tickets (star/vote/comment) to get notified on any progress.

Difference between name.html.erb vs name.erb

What is the difference between name.html.erb vs name.erb?
In particular, are there any reasons why name.erb could be bad to use?
I understand that name.html.erb is the convention - this indicates a HTML template and ERB Engine. But I can't find information if are there any reasons not to use name.html.erb, but name.erb instead.
My new workplace asks me to use name.erb, so I want to know: might there be any problems with this?
In short, no, there won't be any problems. Erb files simply output text. In many cases the file extension is ignored by the reading app as the reading app reads/interprets the containing text and its syntax validity. As #taglia suggests, the file extensions are mostly a 'hint' for you and may also be used by the OS to select a default app to open the file with. See here for a more thorough explanation: Output Type for an ERB File
Rails convention dictates template files to include the extension of the output type and the name of the file should end with the .erb extension. As you mentioned, name.html.erb indicates an HTML template and ERB extension that allows any instance variables in your controller's index action to get passed into the template and used. Similarly, name.js.erb indicates a JavaScript template. See here under 'Conventions or Template Files': An Introduction to ERB Templating
ERB is just a templating language, it is not limited to HTML (you could have name.txt.erb, or name.js.erb). Removing html from the name is just going to make your life more difficult (assuming it works), because you won't be able to know what file you are dealing with unless you open it.

How can I create PHP templates for PhpStorm with existing code inside?

I want to create a php Template in PhpStorm with has a comment block at the top with the usual info (author, creation date, class etc.) but also with a bunch of premade functions.
The purpose of this is that I want to make PHP Unit Class Template with the setup/teardown functions already coded, because these template are used for one project I don't expect they will change as the setups just set global which really should always be set up to make building the test easier (i.e. getting global scoped helpers).
I've tried creating the file templates however when I've copied the code into the template, any variable comes up as in input box when I go to create the file, which might be fine for me using but for someone who's using it for the first time they can screw up by filling in values for this-.
So I am wondering, how can I create a template in PhpStorm which has code in it?
You need to escape $ character which is used by Velocity template engine internally (has special meaning).
You can use ${DS} or \$ for that; so $this will become ${DS}this or \$this .
P.S. ${DS} is a safer choice overall as in some cases \$ may not work.
The official help page has it all explained: https://www.jetbrains.com/help/phpstorm/file-template-variables.html

django allauth how to make a custom design html

I know there's a lot of documentation over the topic, this one, and this one but i couldn't find one that explains so that a 5 year old - or a designer - could understand :) .
My knowledge is html and css, and I need to design the templates for the user login process using Django AllAuth. I'm alone in this one, with no knowledge of python.
Someone please point me to some good documentation to help answering my question:
1 - How can I design each account/page html if I don't know what element is coming? Do I need to work on the views.py file? (possible to do so without any python knowledge?)
2 - how can I actually test all error messages without having to go thru all the login steps every time?
Thank you, guys
I did something like this. It was for django-registration, but the idea is the same.
-Go to github, and clone all the templates. In case, you are not familiar, there will be a folder called templates inside allauth app folder, and download the whole folder. Inside it , there will be base.html, and a folder called allauth.
-base.html is not needed, and you can delete it.
-inside all-auth folder, you will have a bunch of self-evident html files. Open the files, now, the only important content lies between {% block content %}{% endblock %}. Copy that to the html files you want, but make sure to have the same file name; otherwise, allauth woent recognize.
-If you want even more customization, run server, obtain the (soem name)" html codes, and you will see a bunch of html form fiels with id = "(some name)" and name = "". These are HTML fields. As long as you keep the same id and name for each field, you can use them however you want.
Summary: Run server with default allauth templates that you get from github. Go to source of the django generated html files. Copy all the fields that are relevant, and use them however you want.
I know I am not full clear, but it is somewhat a long process.
Here is the official django page: https://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template