Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User:Chao: Difference between revisions

17,076 editsJoined 5 November 2017
(Easy Gallery Project | Skeleton of Thoughts)
m (Easy Gallery Project | Template Tradeoffs)
Line 7: Line 7:
<!--<span style="color:#009000; font-size:30px">COMPLETE!!!</span>-->
<!--<span style="color:#009000; font-size:30px">COMPLETE!!!</span>-->
<span style="color:#FF0000; font-size:30px">IN PROGRESS, still untested</span>
<span style="color:#FF0000; font-size:30px">IN PROGRESS, still untested</span>
<span style="color:#FF0000; font-size:24px">Need to: explain & consider tradeoffs</span>


==Notes to Self==
==Notes to Self==
Line 21: Line 23:
* <span style="color:#009000>It greatly reduces maintenance work.</span>
* <span style="color:#009000>It greatly reduces maintenance work.</span>
* <span style="color:#009000>It simplifies modification work.</span>
* <span style="color:#009000>It simplifies modification work.</span>
<b><u>Are templates really the right choice?</u></b>
* <span style="color:#009000;">Simple to write, simple to read (if it's a template), maintains itself.</span>
* <span style="color:#009000;">easy to change multiple pages all at once</span>
* <span style="color:#009000;">keeps format & any changes consistent across pages.</span>
* <span style="color:#FF0000>Abstracts the purpose of the page - hides how things are done.</span>
** <span style="color:#009000;">The Fix:</span> 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)
* <span style="color:#FF0000>Stiff</span>: Not clean to add unique categories in the middle (ie to add Mantenbo only to Litchi's gallery)
* <span style="color:#FF0000>Can't deal with captions</span>


<b><u>What if someone wants to:</u></b>
<b><u>What if someone wants to:</u></b>
* add a category for files (ie for BlazBlue: Cross Tag Battle or Artbook scans).
* <span style="color:#009000;"><u>add a new gallery category for files (ie for BlazBlue: Cross Tag Battle or Artbook scans).</u></span>
* add a corresponding subcategory on all gallery pages.
1. Create the new category
* rearrange the gallery
2. Add the file(s) into the new category
* change how many items per row are shown in the galleries
3. Add the category to Template:Gallery_Page so all relevant pages will now use it.
* change a specific gallery's number of items per row
* <span style="color:#FF0000><u>rearrange the gallery</u></span>: can't manually rearrange items, can only resort by alphabet or by "time last updated"
* sort the gallery differently (ie by timestamp, alphabetical order, reverse alphabetical, etc)
* <span style="color:#009000;"><u>change how many items per row are shown in the galleries</u></span>: easy, edit the perrow parameter on Template:Gallery_By_Category
* <span style="color:#FF0000><u>change a specific gallery's number of items per row</u></span>: not supported unless you rewrite/manually write the gallery
* <span style="color:#FF0000><u>add captions:</u></span> (as seen in [[Izayoi/Gallery]]) can't use the template to do it.
* <span style="color:#FF0000><u>Add categories unique to a single page:</u></span> (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.


<b><u>How much maintenance is needed?</u></b>
<b><u>How much maintenance is needed?</u></b>


<b><u>How hard is it to add the code that's needed for a suggested change?</u></b>
<b><u>How hard is it to add the code that's needed for a suggested change?</u></b>
<b><u>Alternatives?</u></b>
* 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=)
Note: I believe it's good wikimedia practice to use only ==H2== and beyond (in essence, to avoid using =H1=)


<b><u>Other things to look into later:</u></b>
<b><u>Other things to look into later:</u></b>
Line 58: Line 76:
{{Gallery Page | Character}}
{{Gallery Page | Character}}
</nowiki></pre>
</nowiki></pre>
* <span style="color:#009000;">Simple, I like it!</span>
* <span style="color:#FF0000>Abstracts the purpose of the page - hides how things are done.</span>
** <span style="color:#009000;">The Fix:</span> add DOCUMENTATION that's EASILY ACCESSIBLE on both Template:Gallery Page and on Template:Gallery_By_Category
** (easily noticeable link(s) to "HOW TO USE THIS GALLERY" or "HOW TO ADD A CATEGORY" on the page or something)


===Template===
===Template===

Revision as of 01:36, 7 November 2017

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