Add custom input form in MediaWiki homepage - mediawiki

Where can I put custom input form code in media wiki homepage?
This is so I can modify it into fewer steps for a user to create a new page. The input form will be for entering the title of the new page.
Currently, when adding a page, the user has to search for a page, and if it doesn't exist, it redirects to another page with a link to add the new page. After that it will load the built-in Wiki editor(will also modify this to default to the Visual Editor extension I integrated instead of Wiki editor).
Any input would be greatly appreciated.

There are a number of extensions that can do what you want:
InputBox, is bundled with recent versions of MediaWiki. It is used with Wikimedia wikis, and thus probably very stable.
CreateBox, specifically for letting users create pages
Create Page, more general aproach
Semantic Forms The most fulfledged, but also the most complex, and requires the Semantic MediaWiki extension
You might also want to combine this with some biolerplate extension, e.g. Preloader
As you are posting on SO, I assume that developing your own extension would also be an option. In that case, have a look at the parser functions manual: https://www.mediawiki.org/wiki/Manual:Parser_functions

The file in which i can add/modify a custom input form in the media wiki homepage would be the /rootWikiDir/skins/Vector.php

Related

Is there a way to apply custom CSS before printing a page in a browser?

I occasionally save tutorials from a website as a PDF file for future reference.
My current manual workflow is:
Click the "show on one page" link to get a full single page view of the article.
Open the DevTools of the browser and select sections with advertisements and related links with help of the inspect-functionality and remove them.
Print the page as a PDF file.
I used the Firefox or Chrome-Browser for this, as they both have the required functionality and behave very similarly in that regard.
I noticed that the content I want to remove to get a "clean print" of the content is mostly the same: Let's say all adds are embedded with a div with the class add-banner.
Is there a way to automate these steps?
One idea is to load a custom CSS file that I would need to prepare specifically for a site. Simple rules like .add-banner { display: none; } would allow me to hide the sections that I don't want to print.
I also took a look at console based scrapers because I like the idea to call a command with the URL as a parameter. But the tools I've discovered are image based and I want a indexable PDF file where I can search for text and select parts.
What is the best option to achieve this?
The extension User CSS from the chrome web store (free) allows me to add custom css rules to whatever page is loaded. It is possible to import and export CSS rules and the extension allows to store the custom CSS on a per site base.
This is exactly what I was looking for, since it makes it easier and quicker for me to remove unwanted sections before printing.

Saving static HTML page generated with ReactJS

Background:
I need to allow users to create web pages for various products, with each page having a standard overall appearance. So basically, I will have a template, and based on the input data I need the HTML page to be generated for each product. The input data will be submitted via a web form, following which the data should be merged with the template to produce the output.
I initially considered using a pure templating approach such as Nunjucks, but moved to ReactJS as I have prior experience with the latter.
Problem:
Once I display the output page (by adding the user input to the template file with placeholders), I am getting the desired output page displayed in the browser. But how can I now obtain the HTML code for this specific page?
When I tried to view the source code of the page, I see the contents of 'public/index.html' stating:
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expectedly, the same happens when I try to save (Save As...) the html page via the browser. I understand why the above happens.
But I cannot find a solution to my requirement. Can anyone tell me how I can download/save the static source code for the output page displayed on the browser.
I have read possible solutions such as installing 'React/Redux Development Extension' etc... but these would not work as a solution for external users (who cannot be expected to install these extensions to use my tool). I need a way to do this on production environment.
p.s. Having read the "background" info of my task, do let me know if you can think of any better ways of approaching this.
Edit note:
My app is currently actually just a single page, that accepts user data via a form and displays the output (in a full screen dialog). I don't wish to have these output pages 'published' on the website, and these are simply to be saved/downloaded for internal use. So simply being able to get the "source code" for the dislayed view/page on the browser and saving this to a file would solve my problem. But I am not sure if there is a way to do this?
Its recommended that you use a well-known site generator such as Gatsby or Next for your static sites since "npx create-react-app my-app" is for single page apps.
(ref: https://reactjs.org/docs/create-a-new-react-app.html#recommended-toolchains)
If I'm understanding correctly, you need to generate a new page link for each user. Each of your users will have their own link (http/https) to share with their users.
For example, a scheduling tool will need each user to create their own "booking page", which is a generated link (could be on your domain --> www.yourdomain.com/bookinguser1).
You'll need user profiles to store each user's custom page, a database, and such. If you're not comfortable, I'll use something like an e-commerce tool that will do it for you.
You can turn on the debugger (f12) and go to "Elements"
Then right-click on the HTML tag and press edit as HTML
And then copy everything (ctrl + a)

Isn't the html of the form Django displays on the screen?

Django shows you forms when you do basic coding, right?
Where is the html of the automatically generated form in windows?
So instead of looking for a template folder, once the developer writes the url or views code, he finds the location of the skeleton-only html that Django shows.
In my opinion, it looks like it's built somewhere like an "anaconda/envs" contains a separate virtual environment, but I can't find it.
it's maybe path?
It's well documented:
https://docs.djangoproject.com/en/2.2/ref/forms/renderers/
It loads templates first from the built-in form templates directory in
django/forms/templates
unless you have 3rd party libraries included that override these templates.
However, a quick check in https://github.com/django/django/tree/master/django/forms/templates/django/forms/ shows that this directory is empty.
tl;dr
Django does not render any forms from scratch (unless it's the Admin which of course creates its whole UI automatically). It just enables you to quickly create a template that can render your form but you will still have to provide a basic template (aka HTML markup with dynamic parts) yourself.

FIWARE Wirecloud: which template files are actually used?

We are customizing a Wirecloud installation to provide our own branding, text and header links. We have created a subtheme to the 'defaulttheme' and are overlaying our own template, images and sccs files to accomplish our customization.
We have managed to change the header image, landing page and a few other bits, but are hampered by the following:
The generated HTML provides no clues as to which template it originated from (we think?)
Documentation here: https://wirecloud.readthedocs.io/en/stable/development/platform/themes/
specifies a number of template files, but not all of the template. For example we cannot find the place where the 'Sign in' button is defined.
The wirecloud javascripts seem to insert random bits of html for what should be boilerplate stuff. For example a 'Powered by wirecloud' icon appears at the bottom of the screen. The 'get more components' button appears out of nowhere and we cannot disable it.
Many of the generated elements do not have an id, so it is difficult to disable or identify them in a sccs file. The 'get more components' button for example is not relevant for us, but we cannot remove it (so far).
Does anyone have a completed custom theme we can look at? Or can someone point out which template files / sccs files are used for branding and overall look-and-feel?
True, currently WireCloud doesn't print any comment not any other clue for detecting from what template the html was generated.
Some parts are not generated using templates, for example, the "Sign in" button. I recommend you to create a ticket in the issue tracker for each thing you want to customise and you don't find how to do it, so we will be able to give you a better answer, and to create a template if needed.
Remember that you have to include a "Powered by WireCloud" to comply with the WireCloud license. In the other hand, the "get more components" button can be removed by editing the wirecloud/workspace/wallet/wallet.html template, by removing the following code:
<s:southcontainer>
<t:addmore/>
</s:southcontainer>
Well, this can also be discussed and documented. We usually don't use ids because those elements are better located using some kind of selector.
Anyway, we are working to improve the documentation about themes ASAP.

Mediawiki: configuring the entry page, adding a new page

Have a wiki installed in our organization, and want to start using it.
Failed to find the answers for the next 2 basic questions:
How do I configure the entry page to show a list of all existing pages
How do I create a new page (!). Only succeeded doing it by typing a url of an non existing page. Guess there are nicer methods for this
Thanks
Gidi
For how to show a list of all pages, look at DynamicPageList, which is part of MediaWiki. (There's a more advanced third-party version, but it's not needed for such a simple task.)
Creating a new page really is exactly as you said: Type a URL and save some edits. Most beginning editors will edit a link into a page, and then use that link to browse to the page, so that they don't accidentally forget the spelling and lose the page to the Ether. (Of course it would show up in the recently edited and other special pages.)
This is more of a webapps.stackexchange.com question though.