FANDOM


Forums: Helping Hand > Introducing: Featured image!

Use the following template for a nicely presented post:

{{Forum post|Write your message here!|~~~~}}

Finally getting sick of Elminster's mug on the main page every day for years, I went and created a template for featured images on the main page for all to see. You can see it at Template:Featured image, and in operation at User:BadCatMan/Main Page. There should be a new image every week, and when we fill them up, every day. When we get more than that, we could make them cycle more frequently or randomly. (I pinched the code from another wiki. Meh.)

I've written some guidelines at the documentation. They should be good, clear, interesting images, with full information, showing things from the Forgotten Realms, either in-universe or as book covers and the like. Unlike Featured Articles and Sources, Featured Images are open to everyone to fill up. Unless they get vandalised, then we'll see.

You might like to pick an image corresponding to events in the On This Day feature. That could be interesting.

So, start picking out images you like and setting them up. If it works, we'll put in on the main page. Let me know if you have any queries or suggestions.

— BadCatMan (talk) 08:05, April 11, 2014 (UTC)


More variety on the Main Page! I like it. For those who want to place an image with a particular {{On this day}} entry, I have generated a cross reference between Gregorian dates and Harptos dates that will make it easier to place a related image on the same day as the factoid that it references. See User:Moviesign/Featured image dates for non-leap years.
Moviesign (talk) 02:05, April 12, 2014 (UTC)


Now, can you correlate Earth's leap-years with Toril's Shieldmeet years for On This Day and Featured Images to agree? :)

We could also pick images from new articles featured in Did You Know. Although we're kind of limited to 365/366 Featured Images with a daily changeover, they could be removed and changed as desired.

— BadCatMan (talk) 02:43, April 12, 2014 (UTC)


Do you mean you want new logic in the Featured Image template that compensates for leap years? I can probably do that.
Moviesign (talk) 04:16, April 12, 2014 (UTC)


No, just messing with you. I would have simply numbered each featured image by the day of the year, but there wasn't a MediaWiki "magic word" for a number of the day of the year. Hence the trickier day and month format I borrowed from another wiki. Looking back, I could have tried adapting your {{FR date}} code for it. Maybe I'll try that another time.
— BadCatMan (talk) 04:27, April 12, 2014 (UTC)


I was actually thinking about the leap-year problem, so I wouldn't mind fixing it, but you get first dibs. It can be done either way (using 1-366, or the LOCALMONTH etc.), the {{#time: z}} function will return 0-365.

Actually, it might be even better if we put the images directly in the date pages themselves and then extracted them just like {{On this day}} does it. I will look into this and see if it is possible.

Moviesign (talk) 13:12, April 12, 2014 (UTC)


Okay, I have done a study and it seems feasible that we can use all the Category:Calendar dates pages to hold Featured Images also. That way we don't have to create 366 more pages, and it finesse's the leap-year problem. It requires a simple template, which I called User:Moviesign/Template:Format featured image (for now), to specify images as being "featureable". These can be placed in the date pages as desired. The formatting template has a parameter called usethis which can be used to turn an image on or off from being featured. This could be set by an AM/PM flag for switching between two images on the same day (and with higher math, it could handle more than two per day, which seems excessive, but there it is).

The workhorse template is User:Moviesign/Template:Featured image, which takes a Harptos date (generated by the {{FR date}} template) and returns any featured images found on the corresponding date page. If a page has no featured images on it, then it pulls up the default page which is chosen the same way that {{Featured image}} does—by rounding the current date to the nearest week boundary (1, 8, 15, 22, 29), converting it to the Harptos calendar, and displaying the featured images found on that page.

You can test drive it from my User:Moviesign/Sandbox, it's the first line in the file, so edit the date and click "preview", rinse, repeat. You should see:

  1. Hammer 1 shows Waukeen.
  2. Hammer 2 has no featured images, so it defaults to Hammer 1 (with some text that proves you are using the default template).
  3. Hammer 3 does not exist, therefore nothing is printed.
  4. Hammer 13 does exist, and shows Elminster.

Sorry if I got carried away on this, I hope you like it. Comments and suggestions are welcome.

Moviesign (talk) 19:53, April 12, 2014 (UTC)


I'm not sure that adding Featured Images to the date pages is a good idea. Most FIs will be more-or-less random and so most won't relate to events described in On This Day. Furthermore, we're treating the date pages as normal articles, with main namespace, references, etc. Indeed, those for festival days were already normal articles. So I think we'd be better off developing these as articles, and unrelated images will confuse that.

And keeping the two functions separate would make them easier to operate and manage, and both won't break at once.

— BadCatMan (talk) 03:39, April 13, 2014 (UTC)


Yes, I suppose it is too much to ask that images be somewhat correlated with the dates. We can leave them as separate files, that's fine. Everything else will still work. It will take a tiny bit more logic to handle the leap-year case. How about keeping the User:Moviesign/Template:Format featured image template? If we ever want to change the style or boilerplate around the FI images, we would only have to change it in this one template. It needs a new name, though. It's too long. FFI?
Moviesign (talk) 05:49, April 13, 2014 (UTC)


Okay, my alternative {{Featured image2}} template is ready for testing. It should operate exactly like {{Featured image}} with these added benefits and features:
  • It accepts a date as an optional parameter. {{Featured image2|9 April}} will display the image in the Template:Featured image/9 April file, if it exists, or the nearest weekly file, which in this case would be Template:Featured image/8 April.
  • It uses the {{Ffi}} template to format the image. If we ever want to change the format, it only has to be changed in one place instead of 366 places.
  • It allows two images on the same date, using AM/PM to switch them (note this is according to GMT). {{Featured image2|15 April}} will show one picture of Elminster in the morning, and a different version in the evening.

You can test this out in your own sandbox, or you can use mine (just ignore all but the first line). Only the April files use the {{Ffi}} template, so please limit your testing to dates in April.

If this meets with your approval, I will fully document the code so others can easily understand what it does. All of the documentation that User:BadCatMan wrote applies to this new template, except for minor changes to the "Writing a featured image template" section. If you don't like the name "Ffi", suggest something more pleasing. I want other wikis to copy us, muahahaha! ;-)

Moviesign (talk) 03:57, April 18, 2014 (UTC)


Hey Movie, I will check this out tomorrow... really tired... but it looks cool... and of course it does because you rock at this tech stuff :)
- Darkwynters (talk) 04:24, April 18, 2014 (UTC)


I could work these things out myself. Or, I could wait for Moviesign to do it for me. ;) Sorry, it tends to take me a while to have the time and be back on the topic of some project like this, hence I left it a while. Thanks for finishing it up for me. The code's beyond me now, but it looks good.

I did look at using a template for caption/boilerplate style, but didn't want to mess around with another template in the prototype stage. That would have been a later addition.

I've tended to favour long, obvious template names to make their function clear. So, I don't mind "Format featured image" as a template title. But it's up to you now. It will still just be copy-pasted from the documentation, so it doesn't really matter what it's called.

— BadCatMan (talk) 12:19, April 18, 2014 (UTC)


The new {{Featured image}} feature is live on the Main Page, so check it out now and then. To make it easier for people to add new images to the featured image pool, I created an index that will show you at a glance if a particular image file has already been used. You can sort the table by the file name, or sort it by the Day Of Year (DOY) column if you want to see the images ordered by calendar date. I don't understand why Template:User:BadCatMan/Featured image shows up in the list, it makes no sense. BCM, if you would please, move that file somewhere else when you get the chance, so the index table looks tidy. Thanks!
Moviesign (talk) 16:46, April 20, 2014 (UTC)


I fixed it. When I renamed my old template, it stayed in the Template namespace, thus "Template:User:...". I don't know how DPL works, but it looks like your index searched out all pages in the Template namespace that used "Template:Format featured image" — which had been transcluded into mine by the current featured image. Ergo, it showed up on the index. I've now properly named my file, removing it from the template namespace.

Great work!

— BadCatMan (talk) 00:57, April 21, 2014 (UTC)


Your file didn't directly include the "Format featured image" template so it shouldn't have shown up in the list, but I think i figured it out. The {{tl}} template creates a direct link to another template and it's used on the /doc page that is transcluded into yours. That is what caused it to show up in the index. I think. That's my theory and I'm sticking to it. :-D

Just FYI, The second Elminster image was put on 22 October to get it far away from the other one at 15 April. I was temporarily using it to test the AM/PM part of Featured image on the 15 April page and the index. But I don't care one way or the other.

If anyone has suggestions for improvements to the index, please post here or on the Template Talk page.

Moviesign (talk) 01:41, April 21, 2014 (UTC)


Okay.

Ah, right. Feel free to change it back. Personally, I'd keep the second Elminster where he is to demonstrate the AM/PM system.

— BadCatMan (talk) 02:20, April 21, 2014 (UTC)


All the weekly images (on dates 1, 8, 15, 22, and 29) have been filled. If you want to pick an image for your birthday or something, you'd better get in there before it is taken :)
Moviesign (talk) 22:23, May 18, 2014 (UTC)


Well done! Now we can stick in the rest at our leisure.
— BadCatMan (talk) 05:50, May 19, 2014 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.