#infobox template destroys other templates when put in an article
178 messages ยท Page 1 of 1 (latest)
Ok. 'classname' is the title should have the image in the infobox, right?
if you give your infobox class infobox, then it's gonna be .infobox img {...
got it.
Well, I did wht you told me. Apparently, the thumbnail problem was fixed (?) but the upper green templatewas not.
It is okay if I paste the css code so you check it?
Also, the img properties for the infobox picture is missing after the edit.
".infobox img" goes into the css, but in the template should put '<p class="infbox img"> </p>' closing the 'file' section, or should I use an .div identifier?
I'm trying to send the link, but it appears this message:
use /auth in a main channel
in # general?
yes
did it.
it is, you need to add more classes to the table css
width: 320px applies to the template because it's also "table"
What kind of classes? been comparing my templates to other user's templates in another wiki, and I barely see the differences.
My inbox is almot 90% complete, just need to fix these problems.
table is a general wiki element, you are targeting that right now with your css, that is the issue
you need to make it more specific
How do I put it specific? Is that the reason why my green board is warped like this?:
you can do it by adding more classes to the template, same way you did outerbox, etc
How should I name them without breaking the table itself?
Literally, there are four of them.
Should I put ".infobox table" in the first one, or all of them?
all of them yeah
what do you mean by breaking?
I meant by made it unrecognizable for the wiki to interpret.
Would be better if I put "div.table"?
div is also everywhere so no
just add <table class="class"> in the infobox template?
then .class table in css
ok.
".class table" for the 4 parts, right?
actually you should prob remove the table and use .class instead
then yeah add .class in front of the rest .class td etc
I put them like this...
It fixed the green table! but now there's a gap in the infobox...
hahaha
<th> and <td> will work without a table?
yeah they should
also you should change class to something like infobox haha
class was just the placeholder name, you can name it what you want, just remember to change it in the template too
I'm planning to create many infobox templates, so I doubt if just should carry the name of ".infobox"...
Should i put ".infobox class" or just plain ".infobox"?
well the name is up to you really
just ".infobox"
the flow is, you assign the class with "class=" on template/page then you select the class with css
if you change class=class to class=infobox, then call ".class" in css it wouldn't do anything because it no longer exists
It is valid like this?
should be, yeah
Looks like it's finally done.
But the green board looks weird...
Cheking the green template, the original is slim.
but in the article, It's like it has 10px of padding all around...
these are still universal
ooh.
great.
Just the img properties and the header variants are remaining.
About, the infobox's picture, it has atributtions. One particular function was that the image had rounded corners.
I was using the 'img {...}' part to code it, but the problem was like the previous issues, it had an universal reach, so the thumbnails also were rounded.
you can do .outerbox img
yeap, as outerbox is the container of the infobox the img is in
you can check this kind of stuff with inspect in your browser
Should I not create an aditional <p class= > in the template, right? just the css
for outerbox? you already have that class in there
awesome!
well, I have a last question, but I'll do it later.
I gotta work. See you later, and thank you so much, @wide solstice ^ ^
cya, and np 
and I want to modify as an infobox property
The thing is, I could make separate curly codes in the css, but how do I made them appear properly?
I want is the red one be the default, while the others being a variants, just according to the header name.
I could use the "if " curly keys, but have no idea how to implement them.
what is the thing that you really need to change between them, just background image?
Probably more the #ifeq: you are looking for.
#if: only checks if a string is empty or not, where #ifeq: is the one that actually compared to strings
The ParserFunctions extension provides eleven additional parser functions to supplement the "magic words ", which are already present in MediaWiki.
(It may be configured to provide additional parser functions for string handling; these string functions are documented elsewhere .)
All the parser functions provided by this extension take the form...
I don't think you actually need ifs for that, can just make a few classes and assign them in a template parameter
well you need to check what the parameter is given to serve the right stuff.
Wait actually #switch: might be even better, basically it is a multi version of #ifeq (can see it on the same link I pasted above, jsut further down)
I'm just thinking of something really simple, class="{{{1|}}}" I have that setup in one of my templates and it works
so something like:
{{#switch:{{{type}}}
|red = code here
|blue = code here
|yellow = code here
|#default = code here
}}
of can rename the parametername and values it looks for as you like, and the #default need to exist, as the fallback for if what is served is not one of the other options given, which from your description earlier would be the red option so I geuss in that case, if you went with my names for it, you would just not have the red option at all (as even if people gave a "red" as the value it would since it is not one of the others would still serve that)
but it looks like he at least needs a background color, and a predetermied image, so I don't think something that simple will work in this case
hm I don't see why it wouldn't 
well we both gave our input so let us let him decide instead, what would be best for his specific situation of us going back and forth on it now ๐
true lol ๐
yeah most of it at least, kinda 2 ways you could do it, instead of having it (I assume, that what the SS is from), on the Mediawiki:skinname.css page, you could put it inline on the page in the above switch I mentioned in a style="". Or you switch could assign different classes which you could then give the different stuff on the Mediawiki:skinname.css page.
.classname
{
}
being the syntax in the css page for well classses
lol the code box didn't like starting with that xD
been checking the french and spaniard wikipedia's infoboxes coding, and they are more underanstable than the english one.
can't say I ever checked those 2 versions of wikipedia, but yeah at least the english wikipediae is a bad place to try and import/copy from those are super complicated (though needed for them, due to the size of wikipedia), way too overengineered for the average MH wiki though
templatestyles btw, also you can't use background-image inline by default so he'd have to use a normal image
ohh didn't know that, never tried, in that case well the class assigning method it is then I guess
yeah that and <img> tags don't really work by default I think, security reasons?
and yeah I guess templatestyle is an option too, though I tend it find that harder to work with personally, so try to avoid when possible
I mean the basic [[File:something.png]] basically converts to <img>, so not sure why you bring that up, hardly seems relevant
I'll go out to lunch and will code and show examples later.
um, because it's in the same boat as back-ground img as something that doesn't work ๐ like if you try to use it as plain tags on a page
but unlike background-img it is not a css property, but a html tag, that has a perfectly viable wikitext version, so there is litterally no reason to ever try to use it
not everyone knows that though
can't hurt to share info
anyway, on the actual topic, the solution I was thinking of is this
`template
<div class="{{{type|red}}} header">
css
.red {
background-image: url()
background-color: #
}
.blue {
background-image: url()
background-color: #
}
.green {
background-image: url()
background-color: #
}`
unless he needs something more complicated like different icon/background combinations, I think it would generally work to switch between a set
Hello.
Is it okay if Coded like this?
Which part should I include this?
Here the border with the background color doesn't look well...
css-wise, if you aren't going to change these other stuff per type, you can just put this part under .header so they apply to all of them
you don't need the upper header div, just the type header below it
Okay, fixed both of them.
I want to add a code effect on the icons, but in the css looks like the Wiki doesn't recognize it or something...
In w3schools they work well...
hm not sure but might be because you're using it on a templatestyles page, they use a "sanitized css" model which is a little more restricted
you can try putting that part into commons.css
btw, is accurate to put this code in this part?
or is supposed to go be out of the div?
well me and gummiel suggested two different approaches, and that's the other solution, basically you don't need them both
oh.
if you want to try the switch route, it would go where the type header is currently
my bad, I tough they were both needed.
So, if I put "|type=" field, it willwork with no problem, right?
Woo! it worked.
I was wanting to add default categories, but now its containing different types of character, it'll have to be set manually.
you mean like a category per type too?
it's now complete, but I will have to make a setting for a "preceded by" and "succeded by" for another infobox.
So... in "commons.css" shall I put this code (ignore opacity) for use it in the template?
yeah
also asking this because you can use a switch for that if it's by type, like this
{{#switch:{{{type}}} |fictional = [[Category:Fictional]] |star = [[Category:Star]] |#default = [[Category:Default]] }}
ohh
I was meaning about when you set a hidden category in a infobox, so if you put the infobox code in an article, the article has the infobox's category.
yeah that's what the code would do, assignging a category to the page based on the header type
If you want to give an infobox a category, but now have that category inherited by pages it is used on you need to put it betwee โ<noinclude>โ</noinclude> tags, as that part wont be transcluded https://www.mediawiki.org/wiki/Help:Templates#Control_template_inclusion
If you have standard texts you want to include on several pages, the MediaWiki template feature comes into play.
Unlike extensions and media files, there is no central repository for templates. Templates can be newly written or to save duplicating work already done, exported from another wiki e.g. Wikipedia, and then imported into the target wiki.
It will work with this?
btw, isn't there a way to hidden these templates?
Ohh so you want to just have the page it is used on assigned a category, in that case surround that switch in โ<includeonly>โ<includeonly> tags. (as it then will ONLY get transcluded, not shown/processed on the template's own page), Otherwise the template itself would be getting the Default category as well (since it would be getting nothing as the type parameter there, and thus fall back to the default option in the switch)
In general it is good practice to have everything either inside <noinclude>, or <includeonly>, as it is almost never preferable to have any part of the template both being transcluded, and shown on the template's own page
Well, great.
I want to end this with a last function...
I want to add zebra personalized color according to the header type.
I know the responsible code for the zebra effect:
I don't think adding variant code in here can help.
maybe there's a better way, but you can move the type up like this
<div class="{{{type|fictional}}} outerbox"> <div class="header">
then replace the type and zebra code in the css you have now with this for every type
`.star > .header {
background-image:
background-color: #
}
.star > table tr:nth-child(even) {
background-color: #
}
`
What do you mean by "type" in the css? there's no "type" in the css.
oh, forget it, I think i understood it.
worked great.
I'm finally done with this topic, but I'm thinking how to enable the "mix-blend-mode: overlay" code into common.css...
didn't this work? you'd need to actually assign the "overlay" class in the template also
like <div class="overlay header">
and are you sure it's not background-blend-mode: overlay; you want? since that would affect only the icon
Well, I'm not sure if it would be better,
This is how i want to look like:
The icon blends pretty well with the color, so besides of looking well, it avoids blending with the white text.
I applied "soft light" there in Illustrator, but when looked out in css, the only thing closest to it was "overlay".
I hope just applies to the icon and not the background color...
Here doesn't look like it recognizes the css value, but in the prev looks normal...
oh.. I think you want background-blend-mode: soft-light; then
Does this recognizes well in the template css default, or has to go in the common.css?
commons I guess, but it kinda looks like it's not recognized there either, maybe it's not supported?
you can try though
hmm mix-blend-mode: soft-light; on the header then?