#infobox template destroys other templates when put in an article

178 messages ยท Page 1 of 1 (latest)

halcyon roost
#

regarding thumbnail

  • idk what exactly you've done in CSS, but just using img in CSS will affect all images on wiki, you should really modify it only in tie w/ some class/id, like .classname img
  • after MediaWiki update the way thumb images are rendered has changed: #general message
signal notch
#

Ok. 'classname' is the title should have the image in the infobox, right?

halcyon roost
#

if you give your infobox class infobox, then it's gonna be .infobox img {...

signal notch
#

got it.

signal notch
#

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.

signal notch
#

I'm trying to send the link, but it appears this message:

wide solstice
signal notch
wide solstice
#

yes

signal notch
#

did it.

wide solstice
#

it is, you need to add more classes to the table css

#

width: 320px applies to the template because it's also "table"

signal notch
#

My inbox is almot 90% complete, just need to fix these problems.

wide solstice
#

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

signal notch
#

How do I put it specific? Is that the reason why my green board is warped like this?:

wide solstice
#

you can do it by adding more classes to the template, same way you did outerbox, etc

signal notch
#

How should I name them without breaking the table itself?

#

Literally, there are four of them.

signal notch
wide solstice
#

all of them yeah

wide solstice
signal notch
#

Would be better if I put "div.table"?

wide solstice
#

just add <table class="class"> in the infobox template?

#

then .class table in css

signal notch
#

This is how I have the table in the template:

#

just ignore the "cc".

signal notch
signal notch
wide solstice
#

then yeah add .class in front of the rest .class td etc

signal notch
#

I put them like this...

#

It fixed the green table! but now there's a gap in the infobox...

#

hahaha

signal notch
wide solstice
#

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

signal notch
#

Should i put ".infobox class" or just plain ".infobox"?

wide solstice
wide solstice
#

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

signal notch
#

It is valid like this?

wide solstice
#

should be, yeah

signal notch
#

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...

wide solstice
#

these are still universal

signal notch
#

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.

wide solstice
#

you can do .outerbox img

signal notch
#

oh...

#

So I should put '.outerbox' instead of the infobox, right?

wide solstice
#

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

signal notch
#

Should I not create an aditional <p class= > in the template, right? just the css

wide solstice
signal notch
#

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 ^ ^

wide solstice
#

cya, and np pupCoffeeMH

signal notch
#

good night.

#

I'm back.

signal notch
#

well, see this header?

#

It is located here in the css:

signal notch
#

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.

wide solstice
signal notch
#

Good afternoon.

#

The icon and the background color

misty dirge
wide solstice
#

I don't think you actually need ifs for that, can just make a few classes and assign them in a template parameter

misty dirge
#

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)

wide solstice
misty dirge
#

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)

misty dirge
wide solstice
misty dirge
#

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 ๐Ÿ˜„

wide solstice
#

true lol ๐Ÿ˜„

signal notch
#

Looks like i'll have to separate these codes in a apart {}, right?

#

Hello, Gummiel.

misty dirge
#

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

signal notch
#

been checking the french and spaniard wikipedia's infoboxes coding, and they are more underanstable than the english one.

misty dirge
#

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

wide solstice
misty dirge
#

ohh didn't know that, never tried, in that case well the class assigning method it is then I guess

wide solstice
#

yeah that and <img> tags don't really work by default I think, security reasons?

misty dirge
#

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

misty dirge
signal notch
#

I'll go out to lunch and will code and show examples later.

wide solstice
misty dirge
wide solstice
#

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

signal notch
#

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...

wide solstice
#

you don't need the upper header div, just the type header below it

signal notch
#

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...

wide solstice
signal notch
#

oh...

#

so there's no way to unlock that command.

wide solstice
signal notch
#

btw, is accurate to put this code in this part?

#

or is supposed to go be out of the div?

wide solstice
signal notch
#

oh.

wide solstice
#

if you want to try the switch route, it would go where the type header is currently

signal notch
#

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.

wide solstice
signal notch
#

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?

wide solstice
signal notch
#

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.

wide solstice
misty dirge
# signal notch I was meaning about when you set a hidden category in a infobox, so if you put t...

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.

signal notch
#

btw, isn't there a way to hidden these templates?

misty dirge
# signal notch It will work with this?

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

signal notch
#

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.

wide solstice
#

maybe there's a better way, but you can move the type up like this
<div class="{{{type|fictional}}} outerbox"> <div class="header">

wide solstice
signal notch
#

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...

wide solstice
#

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

signal notch
#

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".

signal notch
#

Here doesn't look like it recognizes the css value, but in the prev looks normal...

wide solstice
signal notch
wide solstice
#

commons I guess, but it kinda looks like it's not recognized there either, maybe it's not supported? ThinkerMH you can try though

signal notch
#

ok.

#

hmm... It appeared this:

#

it appears to recognize it... Somehow.

wide solstice
signal notch
#

I think mix-blend-mode is more accurate, because the other can't process the white color, no matter which type of transparency is set.

#

but with the previous, works well:

signal notch
#

You know what? I'm just going to turn the icons into opacity degradation. No need to add more codes if they're not implemented in MediaWiki.

#

I think this thread is permanently solved. Thanks a lot, @wide solstice and @misty dirge .