I'm making a wiki using Mediawiki. I've seen a right side bar of each page on other wikis.
Like this: http://minecraft.gamepedia.com/Diamond_Ore
The right side bar has information about the thing that the wiki post explains or what ever.
I want to know if it's possible to make that on each page, and how?
I've made an Example page: [Link deleted]
That's my wiki and I want to know how I could add a sidebar to the page.
To make simple yet elegant and flexible infoboxes, first check that the ParserFunctions extension is installed. Then create a template called "Infobox" (or whatever) with the following combination of HTML and wikitext:
<div class="infobox">
<div class="infobox-title">{{{title|{{PAGENAME}}}}}</div>{{#if:{{{image|}}}|
<div class="infobox-image">[[File:{{PAGENAME:{{{image}}}}}|300px]]</div>}}
<table class="infobox-table">{{#if:{{{param1|}}}|<tr>
<th>Parameter 1</th>
<td>{{{param1}}}</td>
</tr>}}{{#if:{{{param2|}}}|<tr>
<th>Parameter 2</th>
<td>{{{param2}}}</td>
</tr>}}{{#if:{{{param3|}}}|<tr>
<th>Parameter 3</th>
<td>{{{param3}}}</td>
</tr>}}{{#if:{{{param4|}}}|<tr>
<th>Parameter 4</th>
<td>{{{param4}}}</td>
</tr>}}{{#if:{{{param5|}}}|<tr>
<th>Parameter 5</th>
<td>{{{param5}}}</td>
</tr>}}</table>
</div>
Replace "param1", "param2", etc. with the parameters that you actually want for your infobox, such as "name", "birth-date", etc. If you need more parameters, just duplicate (with copy-paste) one of the existing parameters and modify it.
Then go to MediaWiki:Common.css and add some styling (if you don't have the necessary permissions to edit MediaWiki:Common.css, you'll have to add this CSS as inline styling to the HTML in the template, or better yet, use the TemplateStyles extension):
.infobox {
background: #eee;
border: 1px solid #aaa;
float: right;
margin: 0 0 1em 1em;
padding: 1em;
width: 400px;
}
.infobox-title {
font-size: 2em;
text-align: center;
}
.infobox-image {
text-align: center;
}
.infobox-table th {
text-align: right;
vertical-align: top;
width: 120px;
}
.infobox-table td {
vertical-align: top;
}
Finally, go to the wiki pages that require the infobox and copy the following wikitext, replacing "Infobox" with the name you've given to your template, and "param1", "param2" etc. with the names you've given to your parameters:
{{Infobox
| title =
| image =
| param1 =
| param2 =
| param3 =
| param4 =
| param5 =
}}
You may safely leave empty or delete any parameters you don't use, as they are all optional. If "title" is not provided, the infobox will default to the page name, which is usually what you want.
I've had to develop infoboxes like these for countless clients, and I slowly arrived to this solution as optimal in regards to complexity and flexibility. Hope it helps someone!
PS for any advanced users: I recommend using HTML rather than wikitext for defining the main table because this way we avoid conflicts with the pipes of the #ifs. In Wikipedia this conflict is avoided by using a template called {{!}} that inserts a pipe, but this results in unreadable wikitext.
Infoboxes are just tables with a right side float and some additional formatting.
{| style="float:right;border:1px solid black"
| My fantastic infobox
|-
| More info
|}
For best practice, you should include your infobox formatting in a class in your wiki's CSS, and define an infobox template instead of creating separate tables on every page.
Not sure how fresh #Sophivorus post is - there is no date so I assume it's from 2018, if not - sorry.
I was searching for a tutorial that would explain the nasty infoboxes and their creation process with no luck. Wiki itself was no help. After 2,5 evening I finally gave up and found Sophivorus' post. It gave me a hint that maybe creating an infobox in HTML with simple CSS is a better ad easier idea.. I thought that the Wiki must convert its s&&&ty infoboxes to HTML and I wasn't wrong! :) I have a nice infobox without learning wiki's scribunto-lua-srua-wikitext monster and much knowledge in HTML and CSS.
I would like to share the solution for dummies like me in a step-by-step way.
Go to a wikipage with an infobox you like (in my case Formica fusca page).
Select whole content of the infobox and right click on its title at the top of the infobox.
Choose to inspect the element (naming might differ between browsers - I use Opera)
Look to the right (a window opened).
Move cursor above the entries in the right window and look for <table class"[..] marker. Note that the whole infobox was highlighted as you moused over the <table class="
Right click on it and go to Copy, then select Copy outerHTML.
Create Template:Examplenamehere page on your MediaWiki, edit it and place copied HTML code there. Edit it as you wish.
As Sophivorus said go to MediaWiki:Common.css and add some styling - you might use the code he/she mentioned.
Styling. In HTML code add classes to elements you wish to style through CSS page (from step 8). You will need at least those: 1) give the whole infobox (in this case it wil be <table class="infobox" bla bla bla>) 2) titles/headers class infobox-subtitle (or whatever; <th class="infobox-subtitle" bla bla>) 3)give sub-title a class if you wish any sub-titles (<td class="infobox-subtitle" bla bla>).
Copy CSS from here or create your code in CSS by yourselves using classes mentioned above
.infobox {
background-color: #ffff00;
border: 2px solid #008600;
float: right;
margin: 0 0 1em 1em;
padding: 1em;
width: 400px;
}
.infobox-title {
border: 1px solid #000000;
font-size: 1.5em;
text-align: center;
background-color: #ff0000;
}
.infobox-subtitle {
font-size: 1em;
text-align: center;
background-color: #fff00;
}
.infobox-image {
text-align: center;
background-color: #ffff00;
}
In HTML:
In places you want the user to add the information paste {{{somenamehere}}} and then create .. a template you will have to place on other pages to invoke your Examplenamehere template:
{|Examplenamehere
|{{{somenamehere1}}}
|{{{somenamehere2}}}
|etc. etc.
|}
To place a header with page name: {{{nazwa|{{PAGENAME}}}}} instead of a title at the top of the table.
If you wish to check or copy my template, go here: http://wiki.mrowki.ovh/index.php?title=Szablon:Opis and inspect the page
Related
I have the following code
<div class="content">
<p>
Arbeitszeugnisse.pdf
</p>
</div>
where content looks like this
<head>
<style type="text/css">
.content {
width: 35%;
float: left;
padding: 0px;
border: 0px solid #8511ae;
margin-top: 0%;
margin-bottom: 0%;
margin-left: 2%;
margin-right: 3%;
background-color: #faf9d8;
}
</style>
</head>
When clicking on the link, the tab title used to be Arbeitszeugnisse.pdf.
After adding a page to the Arbeitszeugnisse.pdf with PDF Arranger 1.4.2 under Ubuntu 20.04.4 and replacing existing file with the new one, the tab title now prints
Layout 1 - Arbeitszeugnisse.pdf
Similarly I have
Bildungsweg.pdf
Bildungsweg.pdf is made up also of multiple files that were concatenated with PDF Arranger. When clicking on Bildungsweg.pdf, the tab title prints
G0-034-F1-20190701130851 - Bildungsweg.pdf
Is there a way to get clean tab titles with no extra text?
You can use the command line exiftool after every PDF edition. For example:
exiftool -Title="" Bildungsweg.pdf
Leave the flag -Title="" empty, without a string. That way, the web browsers will display the filename instead of the metadata incrusted into the PDF.
Take a look at this Gist about anonymising PDFs.
You could achieve the desired result by setting window.status but if it’s an external file I’d have a look at the meta properties of the file generated.
My understanding of the way files are prepared by the PDF parser is that this can be problematic but I think this is where you should begin your bug hunt.
In case you embed the file here is the JavaScript:
<script type=“text/javascript”>
window.status = ‘hello, world’;
</script>
I am building a WordPress website focused on sports and I am using a sports API to get the latest 10-15 highlights videos from different leagues (basketball, soccer, etc). I have been able to get that information, the problem comes that data is displayed vertically, while I would like it to be shown horizontally with a slider/carousel if possible.
I have been looking at Elementor (it's the builder page I am using for WordPress) and several tutorials but I haven't been able to find anything helpful.
I have the following code:
<center>
[jsoncontentimporter url=API I AM USING]
{subloop:results:-1}
{subloop-array:results:-1}
<img src="{results.strThumb}" style="width:275px;height:125px;">
<br>
<strong style="font-size: 10px;">{results.strHomeTeam}</strong>
<strong style="font-size: 10px;">{results.intHomeScore}</strong>
-
<strong style="font-size: 10px;">{results.intAwayScore}</strong>
<strong style="font-size: 10px;">{results.strAwayTeam}</strong>
<strong style="color:#C3414D;font-size: 14px;">{results.dateEventLocal}</strong>
<br>
{/subloop-array:results}
{/subloop:results}
[/jsoncontentimporter]
</center>
I am using the free version of Elementor but I wouldn't mind too pay for the PRO version if necessary, though I believe there is not any block I could use there, and also would like to know if it's possible to do it with HTML since I would like to get deeper knowledge at it.
Does anyone have any idea or any guide I could check to be able to do this with HTML ?
Here's an example of what you could do using mostly CSS
https://codepen.io/panchroma/pen/jOGGPKq
I think what you want to try and do is see if you can add extra HTML around your JSON code. For example, see if you can make some of the text italic with something like
<emphasis>{subloop-array:results:-1}</emphasis>
If you're able to do this, then the next step would be to add additional divs that wrap all of the results, each individual result, and then details within each result. As shown in this screenshot
If you can get to this point then I think you have the problem solved.
You now have some classes that you can target with CSS styling, a basic CSS example would be:
.results-wrap {
display: flex;
overflow-y: scroll;
}
.result {
padding: 5px;
min-width: 200px;
}
.details {
background-color: #fff;
}
https://codepen.io/panchroma/pen/jOGGPKq
I am learning Django. I am customizing the Django Admin page. I have created a base_site.html file in my templates to overwrite the default admin html. Additionally, I have created a stylesheet that I've tied to it.
Here's my problem: By default, there is a div on the right side of the content with an h2 header that states "Recent Actions." I want to change this texts color, but my CSS won't seem to work on these words...
<div id="content-related">
<div class="module" id="recent-actions-module">
<h2>Recent actions</h2>
<h3>My actions</h3>
<p>None available</p>
</div>
</div>
I have tried each of the following CSS:
#content-related{
color: blue;
}
.module h2{
color: blue;
}
#recent-actions-module h2{
color: blue;
}
#content related h2{
color: blue;
}
Nothing works... Am I missing something?
If there is a CSS that's loaded later than the snippets you posted here, that can easily make the issue to appear (later CSS takes precedence). I recommend to open the browser developer console, and inspect the headline - it should show you which CSS style is being used.
If you need some more help, we'd need your base_site.html.
the following code should suffice for the CSS:
h2{color: blue;}
this applies to all future h2 tags on templates that are linked to your CSS file.
Otherwise, if you want it only for Recent Actions use this:
<div class="module></div?
And in CSS:
.module{color: blue;}
You are probably forgetting to link your CSS page. Use this:
<link rel="stylesheet" href="{% static 'CSS/base.css' %}">
Don't forget to add {% load static %} at the top of your html template.
I don't know why you would want to change your Admin page, because virtually noone except you would ever access it. If you are trying to create a portal for users to login view this documentation: https://docs.djangoproject.com/en/3.1/topics/auth/default/
If you 3 is not the case, you should open up your browser's inspect element and view the webpage. Also to save yourself a buttload of time in creating the new look for your admin checkout the Django admin templates on Github.
Here are all the admin html templates to make your life easier.
I have html page with full of link. but they inside the pre tag like below
<pre class="alt2" dir="ltr" style="
margin: 0px;
padding: 6px;
border: 1px inset;
width: 640px;
height: 130px;
text-align: left;
overflow: auto">
http://test.com/files/tivist.r00
http://test.com/files/tivist.r01
http://test.com/files/fdfd.rar
http://test.com/files/gfgf.rar.html
http://test.com/files/trtr.zip
</pre>
</div><br />
The page is full of links like those
Is there any way get only those links form whole page.
I am using notepad++ . If i can get regex which can just extract those links
you can use the following regex to find them all in the document.
http://[^\s]*
I guess you could edit it to or something similiar
http://[^\s"><]*
Besure you set the line by line option off. Notepad++ has a very limited and poorly documented regex engine. Try downloading editpad pro trial edition.
(?<=\<pre.+?)http:\/\/.+?($|\s)(?=.+?\<\/pre\>)
This should only get links that are within a pre tag.
Here is a screen shot from Edit Pad Pro Trial edition
I use a MediaWiki instance on a thumb drive to keep track of a ton of stuff. In the past, I've been in a hurry so I haven't had the chance to look for a nice way to make tables, so this syntax has served my purposes well:
{| border=1
...
|}
Now I want something a little nicer; I'm used to using CSS to make nicer table borders, but I'm not finding a clean way to do this syntax via MediaWiki. Basically, I want a table that looks equivalent to this HTML:
<table style="border-collapse: collapse">
<tr>
<td style="border: 1px solid black">one</td>
<td style="border: 1px solid black">two</td>
</tr>
</table>
Setting border on every cell is going to be difficult. My initial guess is I need to add a table class to a CSS file somewhere; if so, where might the appropriate file be located?
Do like they do in Wikipedia: create a "prettytable" template (see source; you can skip the fancy <noinclude> stuff) where you put some HTML / CSS, e.g.:
border="1" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0;
background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;"
Then use the template like this in your tables; it does a simple "include":
{| {{Prettytable}}
...
|}
The same technique can be used for styling cells. You should find plenty more examples of this in different Wikipedias (and other Wikimedia projects).
You can customise the CSS used via pages in the MediaWiki namespace, for example, MediaWiki:Common.css. There are also skin-specific CSS pages, e.g. MediaWiki:Monobook.css, for the default skin.
As you wrote, you can edit Mediawiki CSS files. This is the way to go; however, if for some reason you can't use CSS, you can always use Wiki templates that contain cell-specific styling tags.
Use this tool to quickly generate the tables - http://www.tablesgenerator.com/mediawiki_tables