Difference between revisions of "User talk:Djonni/Template sandbox"

From GodWiki
Jump to: navigation, search
m (Guild pantheons? A bit of a hack for the link colors)
m (A bit of a hack for the link colors: Very hasty reply)
(Tags: Mobile edit, Mobile web edit)
Line 143: Line 143:
  
 
: Oh right, I did forget one other thing: The guild pantheons, I couldn't see options for those, am I just blind, or is that actually missing? -- [[User:Emptysora|Emptysora]] ([[User talk:Emptysora|talk]]) 05:00, 17 November 2019 (UTC)
 
: Oh right, I did forget one other thing: The guild pantheons, I couldn't see options for those, am I just blind, or is that actually missing? -- [[User:Emptysora|Emptysora]] ([[User talk:Emptysora|talk]]) 05:00, 17 November 2019 (UTC)
 +
 +
:: Not ignoring this, just ran out of time! But thinking about the colour trick and how (un)wise it is to add an option for that. Concern is primarily the code complexity (a <code>{{#if:</code> switch for ''every'' link, gosh) and therefore code readability and maintainability in future... 🤔). Must ponder.
 +
 +
:: Guild Pantheons intentionally omitted, as they are the domain of the guild (so they live on {{tlf|Guild}}). Happy to consider adding them to Usergod, though, but then decisions beef to be made about where: under Pantheons header? Under Guild? -- [[User:Djonni|Djonni]] ([[User talk:Djonni|talk]]) 08:31, 17 November 2019 (UTC)

Revision as of 08:31, 17 November 2019

Not testing the template here, or this page ends up in Category:Gods. Notes to self are going here, and anyone who sees this and is interested. Please discuss, comment, criticize, condemn here if you like! If you'd like to play with this template and test its behaviour, go ahead and replace "{{Usergod" on your page with "{{User:Djonni/Template sandbox". Some of the new parameters are in use now on my God page. I don't even mind much if you directly edit my page instead of messing with yours, I can always revert anything you do/break :)


Objective: {{Usergod}} and {{Usergoddess}} haven't changed since 2013, and I feel like they could be improved without breaking back compatibility.

Q: Why are there no links back to the God's Godville.com page? Always puzzled me. (I mean, for that matter, why isn't there a link to the God's godwiki from the main site either like with guilds, but that's another question altogether.) So, simple matter to add that. Big question though — do I make the change, forcing everyone who uses the template to have a backlink whether they want it or not, or add a link = yes parameter and make it very likely that most people miss the option entirely? Adding it as default won't break anything, but might not be to everyone's taste.

For a compromise position for now, I've adapted the existing (undocumented) name param to display a non-hyperlinked name field.

Q: Why can't I display my medals proudly and prominently in the template? Yeahyeahyeah, I get the idea that building the temple, ark, etc, are actually the hero(ine)'s achievements, so they belong in {{hero}}, but when my hero finishes his temple, I earn a medal. So, why shouldn't it be displayed in the template?

Tried to make this template pass the params to {{God}} but I'm too dumm. I couldn't figure out how to insert the vertical bar to pass the parameter through without it being parsed by the #if: function. Tried {{!}} and the html entity, no joy. This is an okay compromise.

Parameters recognised and passed to {{medal}} include:

  • temple OR hr
  • animalist OR breeder OR zv
  • ark OR ar
  • shop OR tr
  • pairs OR cm

I say OR, it's not strictly speaking an XOR, you could supply both, you would simply get a weird tooltip on the medal (with both fields displayed).

Q: Why are there essentially identical {{Usergod}} and {{Usergoddess}} templates that only differ in the title Goddess? Added a title field because I think there should be one, and because since the prepending of Goddess to the player name appears to be the only material difference in {{Usergoddess}}, I can now easily update Usergoddess to simply be a call to Usergod with a specified title = Goddess. (Or can I? This is the same problem I couldn't solve with passing params to {{God}} in an {{#if:. I'm not SMRT enough for this yet.) This would mean that editors only need to make improvements to {{Usergod}}, but the small number of users of {{Usergoddess}} will neither be broken nor left behind with improvements.

Since I added title I also went ahead and added postnomial, since that seems like a cute thing to have.

Q: Why are there so many parameters for achievements in {{Hero}} and none in {{Usergod}}? There are a lot of achievements that rightly belong to Heroes, and there are equally a lot that rightly belong to Gods.

In intend to implement:

  • Position in long-term pantheons. I think these are stable enough to merit addition to the template, they've got to be at least as stable as things like pet level and current savings that are in {{hero}}.

I might implement:

  • Maximum position in long-term pantheons. I cbf keeping track of stuff like that, but who am I to judge? Plenty of people keep chronicles that are just a pastebin of random stuff like that. If folks want that in their {{Usergod}}, so be it. Should I be the one who bothers to implement it though? Maybe.

I am unlikely to implement:

  • Maximum position in short-term pantheons. Everyone tries for no. 1 in either Creation or Destruction in their first few months, cause it's an easy 'win'. Lots of people care a lot about duelling. But these are so unstable, is anyone sane going to want to update this stuff? I suppose if several of you, dear readers, tell me below that you really want a parameter to commemorate short-term pantheon maxima, then sure. But no point adding gazillions of options nobody wants to use.

I am considering the feasibility of implementing:

  • Actual achievements. It really does make sense for these to be in the template, but the exact method isn't super clear. I think a laborious row-per-achievement is dull, and ugly, and a terrible idea.

Ooooh, I really admire the method used here, perhaps that's an attractive approach? But there are 16 categories of achievement altogether, the logic and layout of it would need to be super thoughtfully implemented. I just don't know if there's a good way to make it attractive for arbitrary achievement sets. The 'sorting' would be doable I think, though a little laborious (renegade = 3/2/1/0, 0 being Honored, and just need to test each in turn 3 or 4 times in ascending order). Perhaps, say, the template defaults to 8-cells wide (for 2 rows of 8 = 16 achievements), but user can set something like achievementcolumns = 10 to alter to their preference? If I have 10 achievements I don't want 8 on one row and 2 orphaned to the next. Would make me learn a ton of the ParserFunctions methods for evaluating parameters, and Learning Is Fun™

Perhaps this is simply wiser to break out to an {{AchievementBlock}} or whathaveyou. Or break out to a dedicated template, and call if wanted from within {{Usergod}}, once I solve my passing-params-in-{{#if: derpiness.


I can only imagine that if you've read this far and aren't me, you must have enough interest to have some kind of opinion. Please share below! --Djonni (talk) 11:56, 7 June 2018 (UTC)

This is a note to myself: along with |hero= and |heroine=, why not |champion= for those who aren't as interested in conforming to the binary paradigm for their, well, champion? Or, alternatives, |herolabel=, just set your own darn label? -- Djonni (talk) 14:51, 12 October 2019 (UTC)

Color and style choices

Notey.png Feedback required

I've made some experimental changes that make the infobox background transparent by default. This template is intended to replace the current Template:Usergod, which has a transparent background. And obviously, since it's mostly used in the User: space, I can't make any changes for people who are inactive (or not very active) to maintain the aesthetic they've chosen to use on their god page.

I've also implemented a really big set of color and style parameters, so that it should be super easy for anyone to quickly put together a nice overall theme and style for the infobox to suit their page's style and theme. I think the styling parameters I've got now are close to final — what I think will really be helpful is to include in the documentation some examples of colour schemes and themes that people can just copy-paste right into their own template.

I'm going to put together a bit of a test set for user pages that have a color background behind their usergod infobox, to try to judge if the new template will ruin the overall aesthetic that they have. -- Djonni (talk) 16:59, 26 October 2019 (UTC)

As per WardPhoenix suggesting that the guild/pantheon sections could have their own color to set them off from the rest, I've implemented a set of simple colour options for these sections (see documentation). The simplest way to create a good colur scheme remains the highlighthex system, but specific options for setting header/label colours, data colours, and border colours exist too.
I also decided to remove the specific style options for the image captions, because it just doesn't seem worth having and replicating across every section. -- Djonni (talk) 12:59, 28 October 2019 (UTC)

Custom section

One of WardPhoenix's suggestions has been to allow users to include their hero(ine)'s details in their God stat block. This is a totally reasonable suggestion which I haven't yet done. But one of the things I've realised as I've surveyed the existing use of {{Usergod}} and {{Hero}} is that people will always come up with unique things that they want to put in the infobos. So, instead of trying to anticipate every little thing that people might want to put into the infobox, I've added an entirely customizable section intended to appear at the bottom that can include an image with caption, and up to nine additional rows with headers, labels, and data in any combination. I'll implement a set of color options for this as well. -- Djonni (talk) 13:05, 28 October 2019 (UTC)

Okay, so taking a closes look at {{Infobox}}, {{Infobox|image(n)=image}} does not work the way I assumed. Which means I'll be re-implementing this section as a subbox, which might or might not get done today... -- Djonni (talk) 13:27, 28 October 2019 (UTC)

WardPhoenix's Feedback

Hello there! Tested the infobox on my special page User:WardPhoenix/Sandbox (well it categorize it but that's not really an issue) so I'll start this section with the feedback.

N.B. Since I have almost none coding knowledge (just started learning Python3 a month ago...) I may make dismissable comments and ideas!


The infobox overall looks good (great work!), and the possibility of choosing our own color is very smart I'd say! On the color topic I have few remark:

  1. The subheader isn't colored, probably an oversight!
  2. The "Guild" and "Pantheons" two column labels are on the same color as all label, making quite weird. Maybe other labels could use a lighter tone, though i dunno if it's that simple considering it still need to be more satured than the "entry" column.

On another note, I didn't managed to include the medals, I might overlooked the exact process on how to include them, may try again later, but the fact that I didn't make it on first try already say something.

About labels:

  1. I think a small emoji before the Guild and Pantheons main labels could do well, but that's not sure. Same for the guild name and the different pantheons, but that's more a details that could be added when everything is wrapped anyway.
  2. I noted that the character + and - can be included in the pantheons parameters


That's all the feedback I have on the infobox itself (unless something else come in mind later).

BUT, I do have a suggestion while you're working on this new god infobox. I don't think I am much wrong if I say that even active users probably doesn't use both of their hero and god page, usually keeping on only the god page. It's kinda a hindrance to switch pages to update the in-game info on the hero one, which is why I personally moved my hero page back to my god page.

I don't know how hard it would be to code it, and you're probably seeing where I am coming now, but I'd suggest to include all the hero parameters within this new god template.

I do remember seeing on some wiki the infobox picture change (and sometimes even the content of the infobox, but can't find back an exemple) just clicking on the button on the infobox without changing page. Thus we could have on the subheader two buttons (god/goddess and hero/heroine) where we could switch between the picture (and eventually information) of both without changing page.

Obviously, if only the change of picture is realistic, we can include the heroes parameters within the template as well under a main label (Hero/Heroine <hero/heroine's name>).

--WardPhoenix (talk) 14:31, 12 October 2019 (UTC)

Hmmm, you have some great ideas there, thank you. I really like the idea of including the hero(ine) details in the usergod template for those who want them... I'll have to think about that carefully, and probably means reworking both infoboxes simultaneously!
While you were writing this feedback out I added a range of other colour and style parameters. I have thought about making the guild and pantheon sections different in colour, I'll add parameters to support that (TODO). Thanks for pointing out the subheader colour issue, the subheader support was added as an afterthought and I'll get that fixed too (TODO). -- Djonni (talk) 14:41, 12 October 2019 (UTC)
Oh, and the reason you couldn't get the medals working! Right now, if you set |name=, then it uses that instead of using {{god|{{PAGENAME}}|all the medals here}}. I can change it so that it still calls {{medal}} after {{{name}}}, though, I didn't think of people setting |name=something and also using the medals parameters. Thanks for pointing this out! -- Djonni (talk) 14:46, 12 October 2019 (UTC)

About Custom:

It seems there is a slight issue with labels (or I make something wrong):

  • If the first customheader is named customheader1 the emoji does appear on it's own header above the customheader1
  • Didn"t manage to make the custom image work
  • Somehow, I have always only one label/data combination that appear

Thanks for your great work! --WardPhoenix (talk) 13:40, 28 October 2019 (UTC)

A bit of a hack for the link colors

On my current usage of the template, what I did to get custom link colors is not link the text designated to be the link and then put an external link to the destination right afterwords with &nbsp; to effectively make the external link invisible (ie: only the arrow image is visible).

From there, you can use the XXstyle parameters set to color: [your color]; to change the "link" color.

For links, I don't believe there is a way to change their color without changing the color of links on the entire website (which is obviously not an option). The anchor tag doesn't actually work in wikitext, so you can't apply a style="color: [your color];" to that. In addition, the style element is also the same way, it also doesn't work. I doubt that the link tag works either, so external stylesheets are out as well. There is a way in MediaWiki to apply custom stylesheets and scripts to the entire site, but it's a per user basis via User:[username]/common.css and User:[username]/global.css, and this might only work on Wikipedia (I think it's a MW setting, and it's likely disabled on this wiki, like many other features, which, of course, isn't a problem, per se)


Eg: [ My Link   ]

<span style="color:#de219f;">My Link</span>[https://google.com &nbsp;]

(For Internal Links): [ My Link   ]

<span style="color:#de219f;">My Link</span>[{{canonicalurl:Talk:Main Page}} &nbsp;]


But hey, you asked for a little trick, so, maybe this'll work?

On a separate note, I never really explored the old Template:Usergod template, so I don't know how much you have added with this modification of the template, but, I think it's pretty darn good. The link issue does drive me nuts, you can't really use blue or red as background colors because of it. My only real complaint is that you're probably going to want to structure the argument list in the doc better (when you publish it obviously) because it was a bit confusing for me. It took a bit to get the hang of it, but when I did, it was pretty consistent which is really nice.

As for the pet/hero/other template inclusions, I'd say, go for it, the more the merrier. Err... you get what I mean. Less template calls and less infoboxes is really good for this kind of thing. It's not like heroes/heroines really deserve to get a box all to themselves (heh), a section would suffice, same with pet, and the other options. Then again, I haven't actually looked at those templates at all. -- Emptysora (talk) 04:58, 17 November 2019 (UTC)

Oh right, I did forget one other thing: The guild pantheons, I couldn't see options for those, am I just blind, or is that actually missing? -- Emptysora (talk) 05:00, 17 November 2019 (UTC)
Not ignoring this, just ran out of time! But thinking about the colour trick and how (un)wise it is to add an option for that. Concern is primarily the code complexity (a {{#if: switch for every link, gosh) and therefore code readability and maintainability in future... 🤔). Must ponder.
Guild Pantheons intentionally omitted, as they are the domain of the guild (so they live on {{Guild}}). Happy to consider adding them to Usergod, though, but then decisions beef to be made about where: under Pantheons header? Under Guild? -- Djonni (talk) 08:31, 17 November 2019 (UTC)