invisible parameters in infoboxes
Forum » The Community / How may we help you? » invisible parameters in infoboxes
started by: BrunhildaBrunhilda
on: 1210259196|%e %b %Y, %H:%M %Z|agohover
number of posts: 11
rss icon RSS: new posts
invisible parameters in infoboxes
BrunhildaBrunhilda 1210259196|%e %b %Y, %H:%M %Z|agohover

Well, I made some infoboxes, like this one.

In use it looks like this

Now, I was wondering if it is possible to avoid some parameters if I do not want some of them to appear at the certain page. For example, this one is about rulers, and some rulers did not have children (the last parameter ({$deca}). Now If there are no children, then this parameter should not appear, but I don't know how to do it, and at the moment, I have to put "none" or just a dash (—). At Wikipedia, infoboxes are made with many parameters, but if you don't write anything, this parameter does not appear at the page. Is this possible here?

Hope I explained myself clearly (somehow I have a sensation that did not :()

Thank you all in advance!
B.

unfold invisible parameters in infoboxes by BrunhildaBrunhilda, 1210259196|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
Helmuti_pdorfHelmuti_pdorf 1210259733|%e %b %Y, %H:%M %Z|agohover

Hi Brunhilda!

There is a trick now discussed in the forum - not to display the labels anymore if the contents of "fields"are empy:

Have a look over the different solutions:

http://community.wikidot.com/forum/t-58403/if-then-else-conditionals#post-159838

Could be useful?


Service is my success.
My webtips:www.blender.org, www.zusi.de

unfold Re: invisible parameters in infoboxes by Helmuti_pdorfHelmuti_pdorf, 1210259733|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
BrunhildaBrunhilda 1210264444|%e %b %Y, %H:%M %Z|agohover

Well, yes and no. It works, but… I still have the cell lines. The entire row should dissapear, too. Look here.

I added those parameters to the last cell "deca". Look here, and the text did dissapear, but the whole row itself is still there… It is a very thin row, but it is still very visible…

last edited on 1210264573|%e %b %Y, %H:%M %Z|agohover by Brunhilda + show more
unfold Re: invisible parameters in infoboxes by BrunhildaBrunhilda, 1210264444|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
ErichSteinboeckErichSteinboeck 1210267101|%e %b %Y, %H:%M %Z|agohover

In http://istorijska-biblioteka.wikidot.com/infobox:vladar you've got the following code:

.
.
  [[cell style="border:1px solid #203819;"]]//{$supruge}//[[/cell]]
    [[/row]]
   [[row style="border:1px solid #203819;"]]
     [[cell style="border:1px solid #203819;"]]
[!-- --][!--{$decaSpecified}--][[[@@|]]]**Деца:**[[/cell]]
     [[cell style="border:1px solid #203819;"]]//{$deca}//[!-- --][[/cell]]
    [[/row]]

By specifying decaSpecified=}} the part between {{[!--{$decaSpecified}--][[[|]]] and is removed, which will leave

[[row style="border:1px solid #203819;"]]
     [[cell style="border:1px solid #203819;"]][!-- --][[/cell]]
    [[/row]]

Which is in fact exactly, what you see: a row with an empty cell.

To remove a full row, you would have to set the “markers” like this:

[[cell style="border:1px solid #203819;"]]//{$supruge}//
[!--{$decaSpecified}--][[[@@|]]][[/cell]]
    [[/row]]
   [[row style="border:1px solid #203819;"]]
     [[cell style="border:1px solid #203819;"]]**Деца:**[[/cell]]
     [[cell style="border:1px solid #203819;"]]//{$deca}//[!-- --][[/cell]]
    [[/row]]

It is nasty, I know.

last edited on 1210313991|%e %b %Y, %H:%M %Z|agohover by ErichSteinboeck + show more
unfold Re: invisible parameters in infoboxes by ErichSteinboeckErichSteinboeck, 1210267101|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
ErichSteinboeckErichSteinboeck 1210275996|%e %b %Y, %H:%M %Z|agohover

I've put together a Community Howto Set Up an Infobox that shows a method to define an infobox, such that only those attributes that you specify on the [[include]] are displayed.

It might be easier to manage this way.

last edited on 1210314023|%e %b %Y, %H:%M %Z|agohover by ErichSteinboeck + show more
unfold Re: invisible parameters in infoboxes by ErichSteinboeckErichSteinboeck, 1210275996|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
BrunhildaBrunhilda 1210281057|%e %b %Y, %H:%M %Z|agohover

Thank you, Erich, it is really nasty. I copied the last part, and it works, but I don't have the idea how it should be in order to have this possibility for every and each cell… As I understood, [!--{$decaSpecified}--][[[|]]]@@ goes inside the previous cell…. ??? And this is what makes it invisible…. Uf…

Thank you for your help….

unfold Re: invisible parameters in infoboxes by BrunhildaBrunhilda, 1210281057|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
ErichSteinboeckErichSteinboeck 1210314361|%e %b %Y, %H:%M %Z|agohover

Check out my post from 8 May 2008, 21:46 — maybe this works better for you.

With this method you can also later change (add optional attributes, …) the template without breaking all existing includes (because optional attributes are invisible by default, all existing includes continue to work as before).

unfold Re: invisible parameters in infoboxes by ErichSteinboeckErichSteinboeck, 1210314361|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
BrunhildaBrunhilda 1210328040|%e %b %Y, %H:%M %Z|agohover

I like it better, really and I tried and I don't get it… Look: http://istorijska-biblioteka.wikidot.com/isbi:pesak

I put [!--{$attrYes}-] in front of the row, as showed here.
(It should look like this in use…

Where I am making the mistake?

And what if a single row has two parameters, like in this one?

And what if I want a raw that has a constant parameter to appear/dissapear (in my infobox, those are green raws….

And how do I make changeable the attribute for photo? Sometimes I just don't have photo…

last edited on 1210328837|%e %b %Y, %H:%M %Z|agohover by Brunhilda + show more
unfold Re: invisible parameters in infoboxes by BrunhildaBrunhilda, 1210328040|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
ErichSteinboeckErichSteinboeck 1210336846|%e %b %Y, %H:%M %Z|agohover

> I put [!--{$attrYes}-] in front of the row, as showed here.
> Where I am making the mistake?

As the howto explains, don't forget to also add [!- --] after the attribute block — see below after [[/row]]:

[!--{$deoYes}-][[row style="border:1px solid #203819;"]]
     [[cell style="font-size:medium; text-align:center; color:#FFFFFF; background:#203819"]] //{$deo}//[[/cell]]
    [[/row]][!-- --]

Then use

[[include ...:pesak deoYes=- | deo=Deo, deo, deo, ...]]

to display deo attribute, or use
[[include ...:pesak]]

to omit it.

> And what if a single row has two parameters, like in this one?
In general: Anything that you put between will show up (if you use “xxxxYes=-” on the include) or will not show if you don't use “xxxxYes=-”.

If you make it appear and the text has one or more replacement parameter(s), then you also need to specify xxxx=value-for-xxxx | yyyy=value-for-yyyy.

> what if I want a raw that has a constant parameter to appear/dissapear
Whatever you want to able to show or don't show: put it between and then use “xxxxYes=-” to show it, otherwise it won't show. If the text within this show/noshow block does not have any parameters (because it's constant) then you simply don't specify a relpacement parameter xxxx=any-value.

> how do I make changeable the attribute for photo?
Same procedure. Put the row (or whatever code displays the photo) between . Then show it using with e. g. slikaYes=- | slika=name.of-photo.jpg

unfold Re: invisible parameters in infoboxes by ErichSteinboeckErichSteinboeck, 1210336846|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
BrunhildaBrunhilda 1210343780|%e %b %Y, %H:%M %Z|agohover

1. I don't understand what should I do when there are more changeable parameters:

[!--{$strana_1Yes}-][[row style="border:1px solid #203819;"]]
[[cell style="border:1px solid #203819; font-size:90%; width:50%;"]]//{$strana_1}//[[/cell]]
[[cell style="border:1px solid #203819; font-size:90%;"]]//{$strana_2}//[[/cell]]
[[/row]][!- --]

Now, where do I put [!--{$strana_2Yes}-]?

I am sorry, but I do not understand this:

If you make it appear and the text has one or more replacement parameter(s), then you also need to specify xxxx=value-for-xxxx | yyyy=value-for-yyyy.

What do you mean by xxxx and yyyy? Do you mean strana_1Yes=some text (if I want it to show) and strana_1=…. if I don't want it to show? What do I put on the right side of = if I don't want it to show?

2. What about the picture?

[!--{$slikaYes}-][[row style="border:1px solid #203819;]]
[[cell style="text-align:center; border:1px solid #203819;"]][[image {$slika} width="290px" style="margin:0; border:0;" alt="{$opis_slike}"]][[/cell]]
[[/row]][!- --]

Is this ok?

3. Constant parameter:

[!--{$slikaYes}-][[row style="border:1px solid #203819;"]]
[[cell style="text-align:center; font-size:110%; color:#FFFFFF; background:#203819;"]]**Губици**[[/cell]]
[[/row]][!- --]

And how it is shown in include template, since right now I do not have those parameters in it.

[[include infobox:bitka
|ime=име битке
|deoYes=- | deo=Део
|slikaYes=- | slika=УРЛ слике
|opis_slike=опис слике
|datum=датум битке
|mesto=место битке
|ishod=исход битке
|strana=страна 1
|strana=страна 2
|zapovednici_1=Заповедници 1
|zapovednici_2=Заповедници 2
|jacina_1=јачина 1
|jacina_2=јачина 2
|gubici_1=губици 1
|gubici_2=губици 2
]]

I made these changes in my infobox (page "pesak" is just my sandbox), but it is still no good. Now, if you see it here, you will see that something is wrong, since [!- --] appears twice above the infobox…. I also tried to put
|strana_1Yes=- | strana_1=Кнежевина Србија, but then everything was just a mess…

This seems very simple at the first sight, but it isn't…. :(

last edited on 1210345624|%e %b %Y, %H:%M %Z|agohover by Brunhilda + show more
unfold Re: invisible parameters in infoboxes by BrunhildaBrunhilda, 1210343780|%e %b %Y, %H:%M %Z|agohover
Re: invisible parameters in infoboxes
BrunhildaBrunhilda 1210358753|%e %b %Y, %H:%M %Z|agohover

Thank you all for all your help and good will, but I think that I'll pass this one. I find it too complicated, and the templates too brutal.

I am reversing all my pages to the previous state before I started this thread.

Thank you again, from the bottom of my heart, you've been all very helpful, but this ¡s too much for me… I just don't get it. :)

last edited on 1210358779|%e %b %Y, %H:%M %Z|agohover by Brunhilda + show more
unfold Re: invisible parameters in infoboxes by BrunhildaBrunhilda, 1210358753|%e %b %Y, %H:%M %Z|agohover
new post
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.