Template talk:Name

From Stardew Valley Wiki
Jump to: navigation, search
This talk page is for discussing Template:Name.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.


Can we get an option to set quality(default/silver/gold) for the image? Bodged a fix using template:quality for the Quality crops bundle, but that one is adding an extra linebreak when used for some reason.Metalax (talk) 12:44, 4 March 2016 (EST)

Line Break

Why does it add a line break to the beginning and end like Crystalarium? --Matthewbuns (talk) 14:55, 27 March 2016 (EDT)

That's because the template adds an ugly(*) "" and the CSS-Definition "display:block" to force line breaks. I added the possibility to add the parameter "class=inline", which changes the CSS-property "display" to "inline" if the template is to be used inline.
(* Not the CSS-Definition is ugly, it's the use of "id" instead of "class". ;-) ) ValaDew (talk) 17:06, 28 March 2016 (EDT)
Clarification on "id"/"class": ID is an unique identifier of the element. CLASS for a group of Elements. If we want to make sure the WIKI works with all possible browsers (even mobile and so on) it should be taken care of using class= instead of id= - especially in templates which are used over and over.


As statet before, I added the option to use classes. Also I prepared the Template for a switch from "id" to "class". In the CSS the definition "#nametemplate" which currently is something like

#nametemplate {
    margin: 2px 5px 1px 2px;
    display: block;
    white-space: nowrap;

can be changed to something like

.nametemplate {
    margin: 2px 5px 1px 2px;
    display: block;
    white-space: nowrap;
.nametemplate.inline {
    margin-right: 0;
    display: inline;

or even "span.nametemplate" and "span.nametemplate.inline", but that'll be over-specific. That's just the same I do in the template. Once these changes are made to the CSS, the span/#switch:-Block

<span id="nametemplate" {{#switch:{{{class|}}} 
|inline = class="nametemplate inline" style="display:inline; margin-right:0;"
|#default = class="nametemplate"}}>

can be made much prettier:

<span {{#switch:{{{class|}}} 
|inline = class="nametemplate inline"
|#default = class="nametemplate"}}>

The "margin-right:0" is necessary to avoid an ugly space behind the name. The margin is ok if used elswhere, but inline it fails. So long :) ValaDew (talk) 17:06, 28 March 2016 (EDT)

Expensive parser function count

This is considered a expensive parser function count:


While this is not:


I came across this while trying to clean the List of Best Gifts by Villager page from redundant link declaration. --Vg-tal (talk) 00:30, 27 September 2016 (UTC)

It contains the {{#ifexist:}} parser expression, which is considered expensive. This is used to determine whether a link should be created or not. I'd suggest removing this check and always create the link, though have no idea whether this breaks anything. Maybe temporarily add a category tag to figure out what pages rely on this check and whether it is appropriate. If necessary, a 'nolink' parameter can be added as an alternative. --Lilly (talk) 18:53, 6 January 2017 (UTC)
Thank for the input! I don't think a 'nolink' will be necessary, the #ifexist is used more as an errors catcher then an option I think. The dead links will be flagged on Special:WantedPages and I will update them with an appropriate link instead. --Vg-tal (talk) 22:18, 6 January 2017 (UTC)