This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

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.

Quality

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.

HTML Style&CSS

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:

{{name|hops}}

While this is not:

{{name|hops|link=Hops}}

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)

Table usage

I dislike the usage of the table in the most recent edit. It can potentially break a lot of stuff involving tables. It's better to use containers and make them behave like tables, like this:

Log Section.png 
(also from Magic Shop Boat)
Grave Stone.png 
(also from Spirit's Eve)

--Spaceeinstein (talk) 19:58, 22 January 2021 (UTC)

I've rolled back the changes in accordance with the policy outlined in Help:Editing. margotbean (talk) 20:10, 22 January 2021 (UTC)
LOL, I came here to drop a screenshot of how I thought this might be impacting tables (had some weird formatting going on in the List of All Gifts page) but in my 10 minutes of distraction the change was rolled back and my screenshot removed due to lack of usage. Max efficiency :D. Thank you! Efarn (talk) 20:18, 22 January 2021 (UTC)
Thanks for your understanding! I'm aware that Template:Name looks awful on mobile (among other problems), and hope to get that fixed when the wiki moves to its new url. margotbean (talk) 20:26, 22 January 2021 (UTC)
Ok sorry I wasn't aware it could break other things playing this way with tables, and thank you Margotbean for making the corresponding changes in the Furniture Catalogue page! Actually, I was thinking that it shouldn't have posed problems to old usages of the template as all the changes was only made if the parameter Description was present or am I mistaking? And thank you Spaceeinstein, I didn't know this usage to display tables without being in a table section. But do you think it's worth to create a new template for a few occurences in only one page? ClemNad (talk) 22:53, 22 January 2021 (UTC)