User:Chao

17,076 editsJoined 5 November 2017
Revision as of 01:36, 7 November 2017 by Chao (talk | contribs) (Easy Gallery Project | Template Tradeoffs)

I'm gonna use this page as a scratchpad for what I'm gonna call the Easy Gallery Project, a project that aims to make Galleries on this wiki easy to use, maintain, and update through the use of templates and DPL (the DynamicPageList extension).

Progress

IN PROGRESS, still untested

Need to: explain & consider tradeoffs

Notes to Self

List of handy DPL references:

Is DPL really the right choice?

  • It could slow the wiki down.
    • (supposedly - test this to see if the slowdown is acceptable)
    • allowing DPL to cache results also greatly speeds up load times, especially if the content is largely static (unchanging), which it should be.
  • It greatly reduces maintenance work.
  • It simplifies modification work.

Are templates really the right choice?

  • Simple to write, simple to read (if it's a template), maintains itself.
  • easy to change multiple pages all at once
  • keeps format & any changes consistent across pages.
  • Abstracts the purpose of the page - hides how things are done.
    • The Fix: add easily accessible documentation on both Template:Gallery Page and on Template:Gallery_By_Category
    • (easily noticeable link(s) to "how to use galleries" or "how to add categories" on the page or something)
  • Stiff: Not clean to add unique categories in the middle (ie to add Mantenbo only to Litchi's gallery)
  • Can't deal with captions

What if someone wants to:

  • add a new gallery category for files (ie for BlazBlue: Cross Tag Battle or Artbook scans).
1. Create the new category
2. Add the file(s) into the new category
3. Add the category to Template:Gallery_Page so all relevant pages will now use it.
  • rearrange the gallery: can't manually rearrange items, can only resort by alphabet or by "time last updated"
  • change how many items per row are shown in the galleries: easy, edit the perrow parameter on Template:Gallery_By_Category
  • change a specific gallery's number of items per row: not supported unless you rewrite/manually write the gallery
  • add captions: (as seen in Izayoi/Gallery) can't use the template to do it.
  • Add categories unique to a single page: (as suggested in Mantenbo's history): can't use the template to do it, or else add the page to the template and bloat the template with irrelevant code.

How much maintenance is needed?

How hard is it to add the code that's needed for a suggested change?

Alternatives?

  • try to change to a more manually flexible method? What are the tradeoffs?
    • ie "when creating a gallery, copy/paste this code and remove unnecessary categories. Then, to add an automatic gallery copy/paste this code. To add a gallery with captions add this code." or something.

Note: I believe it's good wikimedia practice to use only ==H2== and beyond (in essence, to avoid using =H1=)

Other things to look into later:

Template:Gallery Page

Idea: automatically check if each gallery is empty or not & if empty, skip the header.

  • ie for Bullet, skip XBlaze Code:Embryo under Story since she doesn't have any pictures in that category.
  • how to do this across all categories on a Gallery Page without making the template impossible to read?
  • how do you do this with DPL? -> you don't. Count them with {{#ask}} GO TEST THIS
    • {{#ask: [[Category:{{{1}}}]] | format = count}} returns a number that I can use?
would an if statement like this work?? (this is pseudocode)
{{#if: get page count | do nothing | else show header and query DPL for the gallery }}

Usage

{{Gallery Page | Character}}

Template

<includeonly>
{{TOC}}

{{#if: page count of {{{1}}} and Main Artwork = 0 | /*do nothing*/ | /*else*/
==Main Artwork==
{{Gallery By Category|{{{1}}}|Main Artwork}}
}}

==Sprites==
===Battle===
===Palette References===
===Lobby Avatar===

==Character Crest==

==Arcade==
("Arcade Endings" on Noel's page)
===Calamity Trigger===
===Continuum Shift===
===Chrono Phantasma===
===Central Fiction===

==Story==
===Portraits===
===Calamity Trigger===
===Continuum Shift===
===Chrono Phantasma===
===Central Fiction===
===Clone Phantasma===
===XBlaze Code: Embryo===
===XBlaze Lost: Memories===

==Novels==
===BlazBlue: Calamity Trigger — Part 1===
===BlazBlue: Calamity Trigger — Part 2===
===BlazBlue: Continuum Shift — Part 1===
===BlazBlue: Continuum Shift — Part 2===

==Artwork==
===Promotional===
===Birthday===
===Special===
===Chibi===
===Unlimited VS===
===Wallpapers===
===Stickers===

==Production Art==
===Model Sheets===
===Early Designs===
===Storyboards===
</includeonly>

Template:Gallery By Category

Usage

{{Gallery | Cat1 | Cat2 }}

Example:

{{Gallery | Touya Kagari | Early Designs }}

Template

{{#tag:DynamicPageList|
category = {{{1}}}
category = {{{2}}}
namespace = file
ordermethod = sortkey
order = ascending
galleryshowfilename=no
imagesperrow=7
gallerycaption=No caption
mode=gallery
}}