User talk:Djonni/Template sandbox/Usergod

From GodWiki
Jump to navigation Jump to search

Notes to self

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

It seems last update created a little bug, it made the guild and pantheons icon disappear even without |emoji/icon=no (unaffecting custom section icons though) --WardPhoenix (talk) 13:28, 30 November 2019 (UTC)

Fixed, thank you for the report! -- Djonni (talk) 13:37, 30 November 2019 (UTC)
Apologies, went straight to add the parameter & didn't even notice that the icons were no longer showing. Checked & all 5 cases (no param, = y & = n, icon or emoji) behave correctly. -- S624 (talk) 13:54, 30 November 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>[ &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)
At least on mobile, guild pantheons already display with the other pantheons. I thought this was true for web as well. β€” Emptysora (talk) 00:04, 18 November 2019 (UTC)
Mmm, you mean on Godville, I think? Yep. And that's a fairly good argument for having them available in Usergod, along with a general principle of allowing people to do what they want with it, so I'm convinced :) Are you suggesting that you'd put them with the other Pantheons then?
I'd actually love to hear WardPhoenix's opinion on this, as he was (maybe is again?) proudly a one-man guild :) GodWardPhoenix , πŸ‘‹ do you think that the Guild Pantheons should be displayed with the other Pantheons, or as part of the Guild section? -- Djonni (talk) 03:47, 18 November 2019 (UTC)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Pardon if I used the outdent template wrong, I only today discovered it existed (after WardPhoenix used it on the main page). I think it should be displayed with the other pantheons for sake of consistency with the game, but, I too would love a third opinion. β€” Emptysora (talk) 08:03, 18 November 2019 (UTC)

Well, in my opinion, I'd say the guilds poantheons doesn't really belong to a Deity template, but I can understand the logic of having it, since it's on the superhero page... After all, if someone doesn't want to display it on it's usergod template he/she just have to not enter the data about it. As Djonni "general principle of allowing people to do what they want with it" (Oh, and I guess putting them under the header guild pantheons would do the job). --WardPhoenix (talk) 10:32, 18 November 2019 (UTC)

Section Custom Fields

Any chance we can get a (few) custom fields for the guild and pantheon sections. A few extra tidbits that may be relevant to those sections that you want to be included with the standard templates and not spread out to another section. --Sand Devil (talk) 16:32, 26 November 2019 (UTC)

Hmm πŸ€” I don't see why not, hadn't occurred to me. But I definitely see the benefit, for the Guild section certainly, and can be convinced for Pantheons. Though don't forget, the actual {{Guild}} template will be overhauled Soonℒ️ too...
What should these be named? |guildcustomheader1=, |guildcustomlabel1=, |guildcustomdata1= etc. feels... Clunky, but at least they're unambiguous. Would 20 rows be okay?
As far as Pantheons go... What are you thinking? What's a use-case? This isn't a no, just understanding how it would fit with the rest of the Pantheon information 😊 -- Djonni (talk) 17:56, 26 November 2019 (UTC)
I was thinking 5, but yeah, 20 should handle our most creative guild masters.
I hadn't thought it through, other than guild stuff. Because those sections are handled differently, with their own color layouts, just thinking that if someone wanted to group their own custom data with those sections, they wouldn't be able to.
Now that I think of it, I can see a use case. Best / original ... Best Duel status - 4, current duel status 14. Original Temple pantheon 27847 current 27805. Maybe not as much of an application, I could also see people coming up with their own, such as crosswordery pantheon. --Sand Devil (talk) 18:48, 26 November 2019 (UTC)
Ahhh, y'know you're absolutely right, there have been unofficial Pantheons, like the ill-fated Crosswordery, and Drinking, and of course there have been two Pantheons of Wikidness so far! Alright then, we'll have custom headers, labels and data rows for both Guild and Pantheon sections. And fair enough to display either your best position in the Pantheon, or your target, both legit uses.
Any feedback (from anyone) on having sensible names for those parameters? |guildcustomtypen=, |pantheoncustomtypen=? Twenty each? -- Djonni (talk) 19:55, 26 November 2019 (UTC)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Since I couldn't see any technical reason why not, I've added support for up to 50 custom rows at the end of both the Guild and Pantheon sections. (More than this and we start risking complications down the track, if more non-custom rows are added to these sections.) |guildcustomheadern=, |guildcustomlabeln=, |guildcustomdatan= can be used for the Guild section; |pantheoncustomheadern=, |pantheoncustomlabeln=, |pantheoncustomdatan= can be used for the Pantheon section.

A couple of things to note:

  • These custom rows share the styling of the rest of their sections. If you want to custom style rows, the Custom section's equipped for that.
  • If no "real" (named) parameters are given for the sections (e.g, |guild=, |position=, or |rank= for Guild; a pantheon parameter for Pantheon) then the section won't appear at all, and any custom rows won't be visible. This could be changed, of course (everything can be changed), but I'd probably want to know why someone's not using the Custom section instead, if they have no interest in a section's regular parameters, as it probably indicates that something needs to be fixed to meet user expectations.

While I was there, I expanded the custom section from 40 to 99 rows, because πŸ€·β€β™€οΈ it's trivially easy to do so. More than 99, though, would not be trivial, and I'd suggest that whoever wants to do that should really just be building their own bespoke {{Infobox}} for whatever that idea is.

I have tested the new custom rows offline and I'm about 96% confident there's no bugs or typos in the added code, so there's probably no need for anyone to add another... 139 custom rows to their test boxes πŸ˜… And since the code's all boilerplate, it's extremely unlikely that there's a bug or typo that only affects a single row.

Let me know, though, if I've missed something obvious or it doesn't behave the way you expected! -- Djonni (talk) 09:58, 27 November 2019 (UTC)

Guild Field

Hi, is there any way to boost the size of the guild name field? or customize it guildstye something or other. On my page, the Legion of the Dead name seems to disappear with the size of the icon above it. Or maybe I should get a new icon that is smaller.

BTW, thank you, you and WardPhoenix have given me great advice as well as building this very nice template. --Sand Devil (talk) 19:10, 6 December 2019 (UTC)

Here's what I'd suggest: turn off the automatic guild linking with |guildlink=no, and then make the text exactly the way you want with something like this: |guild=<span style="font-size: 150%; font-weight: bold;">[[The Legion of the Dead]]</span>, or maybe |guild=<span style="font-size: 150%; font-weight: bold;">The Legion of the Dead</span> [[The Legion of the Dead|(link)]], or whatever. Tweak to suit, of course! 😊 -- Djonni (talk) 20:38, 6 December 2019 (UTC)

Almost perfect! Legion of the Dead, not the Legion... as always your feedback is spot on and very appreciated, thank you! --Sand Devil (talk) 23:55, 6 December 2019 (UTC)

By the way, I though maybe we could add something useful for those who have a guild picture in their infobox : adding a |link= parameter that would link to the guild instead of the file page when clicking on the picture. I did something like this on {{Sign}} to link picture in the template, use it if it can help: |link={{{link|File:{{{img}}} -- WardPhoenix (talk) 00:09, 7 December 2019 (UTC)
Mmm, I am honestly pretty reluctant to keep piling on more parameters and options. It's already a bit heavy. Perhaps the image can automatically link to the guild page by taking the contents of the |guild= field. If that parameter's blank, or |guildlink=no, it will behave as usual (link to file page)...? Hmm. πŸ€” Gotta think about this one. -- Djonni (talk) 13:46, 7 December 2019 (UTC)
To pile on my 2c here: I love having options, but you have to make sure it is easy and rewarding to use for a beginner. Otherwise, people will be intimidated from contributing. --Sand Devil (talk) 21:51, 8 December 2019 (UTC)