Project:Navigation Galleries: Difference between revisions
NitramLegov (talk | contribs) (Moved sandbox link) |
m (→Outsourcing Parts of a Page: fixed invisible br) |
||
Line 87: | Line 87: | ||
# split the page into one page per section | # split the page into one page per section | ||
# start each sub-page with a <br> tag above the heading in target format (usually <code>== h2 ==</code>) | # start each sub-page with a <nowiki><br></nowiki> tag above the heading in target format (usually <code>== h2 ==</code>) | ||
# set a common property for the sub-pages (e.g. Machinetype) | # set a common property for the sub-pages (e.g. Machinetype) | ||
# insert an embedding query for pages with this property, making sure to use embedonly=yes | # insert an embedding query for pages with this property, making sure to use embedonly=yes | ||
Line 98: | Line 98: | ||
|embedonly=yes | |embedonly=yes | ||
}}</pre> | }}</pre> | ||
== Semi-Automated Assembly (Python Script) == | == Semi-Automated Assembly (Python Script) == |
Revision as of 20:46, 4 May 2022
ProjectInfoBox Galleries for Visual Wiki Navigation | |
---|---|
Status: | ongoing (restart of Project:Multi-Photo Imagemaps with a much more practical approach) |
Release Date: | semi-automated: 2019 automated: 2021 |
Initiator: | Lukas |
Team: | Martin, Rudy, Stefanr |
Materials Used: | photos |
Tools Used: | cameras, e.g. DSLR |
Software Used: | MediaWiki, Semantic MediaWiki, Python (legacy) |
Approx. Cost: | 0 € |
Let's try to improve visual navigation through this wiki, but in a much easier way than originally tried with Project:Multi-Photo Imagemaps!
Imagemaps of multiple photos did solve some problems, but are still too hard to modify for anyone really doing it - you'd have to download the original GIMP files, add a new photo (or better several ones so it would still look okay), upload everything again, overhaul the embedding code, ...blah.
Instead, let's use the photos we already have (e.g. in InfoBoxes) in automatable "Navigation Galleries"!
There's a little template for easy linking to this page: just insert {{NavGal}}
on any relevant page.
Manual Assembly
We already had a few such navigation galleries before "opening" this project, e.g. disambiguation pages or Lukas' project overview.
It's definitely possible and not too difficult to make the galleries by hand in slowly evolving cases like these!
Simply use the gallery syntax and make sure you include a link to the page you want to direct readers to, so they don't just see the page with photo information:
<gallery mode=packed-hover heights=150 caption="optional 'headline' - enter what you want"> File:example1.JPG|link=[[Example Tool]]|here's room for a photo-specific caption... File:example2.JPG|link=[[Different Example Tool]]|...and here you put the next photo's caption! </gallery>
The exact formatting here is just an example of course, whatever works will surely be appreciated by the next page visitor!
Advantages of the manual approach are mainly A) ease of use (requires nothing but a wiki account) and B) the flexibility to assemble the gallery out of any photos and captions you like.
Pages in Need
Here are some of our pages where such a gallery would be nice (feel free to add more):
- Category:Engineered Woods
- Category:Bits - especially highlighting differences between different drill bits and end mills
- Category:Joinery - demo pieces or sketches of various woodworking joints - not much content yet
- Material:Crimps - much easier to go by picture than (interchangeably used) names - page doesn't exist yet
- Pliers
- perhaps the projects on your user page?
- it would be cool if every type of power tool and machine had a list of project ideas
- <what else?>
Automated Assembly (SMW)
We can automatically generate nice galleries with Semantic MediaWiki! For good results, all pages should have ONE value for each of these properties:
- Has image
- Has German [not used for projects]
- Has caption
All of these values are usually set automatically by the MachineInfoBox or ToolInfoBox (parameters image
, german
, and the page name) or ProjectInfoBox (parameters image
and project title
[no second language]).
Examples
- Projects
- hardware grouped by its location
- "sandbox" for further improvements: Project:Navigation Galleries/Sandbox
Overriding InfoBox Automation
InfoBoxes may generate poor gallery elements if...
- there are multiple InfoBoxes on a page
- the page name is not a good English caption
- ..?
You can therefore inhibit the influence of any such InfoBox on the page's SMW parameters by adding a value for the extrabox
parameter. The box will appear just the same to a reader of the page, but its image/caption/German caption will not appear in SMW galleries.
If you turn all InfoBoxes on a page into "extraboxes", the page will only look nice in galleries if you set the properties by hand, e.g. at the very bottom of the page:
{{#set: |Has image=File:Metabo BS 1638 W.jpg |Has caption=Bandsaw (Wood) |Has German=Bandsäge (Holz) }}
Outsourcing Parts of a Page
There may be cases where we want to have several InfoBoxes on the same page, but also have several of them appear in galleries. An example of this were our bandsaws that are located in two different areas (wood and metal). For details, see this and the following comment on the corresponding issue - in short, here's what to do:
- split the page into one page per section
- start each sub-page with a <br> tag above the heading in target format (usually
== h2 ==
) - set a common property for the sub-pages (e.g. Machinetype)
- insert an embedding query for pages with this property, making sure to use embedonly=yes
Example (from Bandsaws):
{{#ask: [[Machinetype::Bandsaw]] |order=descending |format=embedded |embedonly=yes }}
Semi-Automated Assembly (Python Script)
Lukas started and never really continued once results got okay to develop a script (using Martin's "wikicrawler" for our QR code printouts as a starting point) that automatically goes through certain wiki pages and gives out the wiki code for a large navigation gallery when you run it.
A first example was the "Project:" namespace, which is quickly filling up with awesome members' projects that were unfortunately not very visible before generating such a gallery on the Projects page (check out how this looked before we fully automated it). In general, many namespaces or categories could benefit from such a possibility!
This approach is not really in use anymore since we figured out the fully automatic way.
- advantage: customizable aesthetics (more "modes" than the SMW approach allows so far)
- disadvantage: manual execution and copy/pasting required for each update
(Planned) Features
- project gallerizer
- filtering of insufficient pages (no ProjectInfoBox, default image, no image) ✔
- alphabetical gallery generation ✔
- randomized gallery generation ✔
- "recently updated" gallery generation
- topic-based gallery generation, e.g. "woodworking projects"
- (later) equipment gallerizer
- e.g. all power tools
The current code can be found on GitHub: comakingspace/Navigation-Galleries.
Further information & discussion in issue #96 (closed)