Topic on Project:Support desk

How to create article series?

23
DStallTX (talkcontribs)

Where can I find help creating article series like this - https://en.wikipedia.org/wiki/Botany ?

or just creating something like this - https://en.wikipedia.org/wiki/Horse ?

or simply how to move TOC to right side of page like this - https://en.wikipedia.org/wiki/Enlightenment ?

I tried following instructions here - https://en.wikipedia.org/wiki/Wikipedia:Article_series but I ended up with some kind of Template loop error. Obviously, I did somethign wrong. Can someone please guide me through this step by step?

Bawolff (talkcontribs)

the information at https://developer.mozilla.org/en-US/docs/Web/CSS/float may be helpful. These are all floated elements.

You can rearrange the table of contents with the __TOC__ magic word - so you can put it in a div that is floated right and has a width set.


E.g. (using wikitext editor not visual editor)

<div style="float:right;width:20em;border thin solid black">__TOC__ or other content here</div>

DStallTX (talkcontribs)
Bawolff (talkcontribs)

the series boxes are also just floated content.

DStallTX (talkcontribs)

But how do you call up a series? Table of contents is _TOC_ yes? So what is series?

Bawolff (talkcontribs)

There is no such thing as a series. Its just a box with some links in it.

DStallTX (talkcontribs)

On my ModWiki | Humanity page, I created right sidebar div like you showed me, and placed source code from this Wikipedia page for sidebar in it. — NOT the source code from there but from Wikipedia:Article series

and this showed up - Template loop detected, Template Documentation.

So I created Template Documentation and added code per Wikipedia Templated:Documentation and then Template Documentation text disappeared and Templates: Sidebar with collapsible lists showed up in its place

So I created Template:Sidebar with collapsible lists by copying/pasting code from Wikipedia Templates:Sidebar with collapsible lists and now I have Template loop detected: and beneath it Template:Sidebar with collapsible lists, but no right sidebar.

Can you please give me some more info about how to create this right sidebar based on Wikipedia code?

I don't know enough about programming to follow How to resolve template loop detected issue in MediaWiki

This post was hidden by DStallTX (history)
Bawolff (talkcontribs)

The version on your wiki looks nothing like the version on wikipedia. It sounds like you copied the usage instructions not the template? The end result is that you made a template that uses Sidebar with collapsible lists, instead of creating that template - hence the loop error, as you tried to define it in terms of itself. Anyways, You have to press edit or view source on the wikipedia page to see the source code of the template.


Additionally this template requires extension:Scribunto to work, so you should install that if you want to copy it.


If you want to copy templates, consider using the page Special:export on wikipedia (be sure to check, include templates), which will download a file, and then use Special:import on your wiki to import. This is a lot easier than manually copying.

DStallTX (talkcontribs)

I pasted code copied from Usage section on https://en.wikipedia.org/wiki/Template:Sidebar#Usage and Template:Sidebar text link shows up on my ModWiki | Humanity page in right sidebar.

Per Wikipedia Special:Export page https://en.wikipedia.org/wiki/Special:Export - I search Wikipedia for Special:Export/Template:Sidebar, and this is what I get -https://en.wikipedia.org/wiki/Special:Export/Template:Sidebar

When I copy and paste that into my Template:Sidebar page, this is what I get - https://dstall.com/MOD/index.php/Template:Sidebar

When I upload Scribunto extension and activate it in LocalSettings, all that Template:Sidebar text is added to right div box at my Humanity page, ending in Script error: No such module "Sidebar".

When I copy code from https://en.wikipedia.org/wiki/Module:Sidebar and paste into Module:Sidebar page on my site I get this - https://dstall.com/MOD/index.php?title=Module:Sidebar&action=submit

Bawolff (talkcontribs)

> Per Wikipedia Special:Export page https://en.wikipedia.org/wiki/Special:Export - I search Wikipedia for Special:Export/Template:Sidebar, and this is what I get -https://en.wikipedia.org/wiki/Special:Export/Template:Sidebar

As i said before, you need to make sure the "include templates" checkbox is checked. You have to go through the form on special:export, writing the page name into the "add pages manually" textbox and checking the include templates checkbox, you cannot do the search for subpage thing as that will not include templates.

> When I copy and paste that into my Template:Sidebar page, this is what I get - https://dstall.com/MOD/index.php/Template:Sidebar

You cannot copy and paste the output of special:export. You have to use the page special:import on your wiki to import the saved file.

> When I copy code from https://en.wikipedia.org/wiki/Module:Sidebar and paste into Module:Sidebar page on my site I get this - https://dstall.com/MOD/index.php?title=Module:Sidebar&action=submit

You get an empty page?

to be clear when you say you copy and paste from https://en.wikipedia.org/wiki/Module:Sidebar you actually mean from the text box on https://en.wikipedia.org/w/index.php?title=Module:Sidebar&action=edit , right ?

DStallTX (talkcontribs)

This is so messed up, I can't begin to tell you what I did with what result.

Pls start over. Tell me what Wikipedia page to name for Special:Export incl template, and what within that export to copy/paste into my nav div on my ModWiki | Humanity page.

I've gotten error message before that there's no Module:Sidebar, so pls be specific and include ALL parts/steps that are needed to get this working. Undoubtedly, there are Templates and Modules involved because I've gotten errors naming such.

I need help understanding what's being explained at MediaWiki Manual:Importing Wikipedia infoboxes tutorial, and on Wikipedia pages - Infobox, Help:Infobox, Wikipedia:List of infoboxes.

I need to outline this procedure step by step - including what Modules and Templates I need to setup, all pieces involved, step by step in order.


Now I can't Special:Import because Wikibase is not installed and I have NO IDEA how to install it on shared hosting. Is that possible? If not, now I'm dead in the water! Could this be yet more complicated?

Import failed: The lua binary (.../domains/dstall.com/public_html/MOD/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua) is not executable.

After digging around, I was able to download and install Wikibase extension, modify composer.local.json sample file and save as .json file, and modify LocalSettings with extension registration (item 1.Enable Wikibase Repository only - 2nd item)/

But now I get Error: Class 'Diff\Differ\MapDiffer' not found.

After deactivating Wikibase extension in LocalSettings, I was able to successfully import MediaWiki:Common.css from Wikipedia, but now when I go to my my MediaWik:Common.css there's an internal error - MWException: The lua binary is not exectuable https://dstall.com/MOD/index.php/MediaWiki:Common.css

Bawolff (talkcontribs)

wikibase is very complex to install and setup. I would reccomend modifying templates to not use it if possible over trying to set it up.

The lua binary is not executable error suggests there was an error in how you uploaded the extension files. Normally if you extract a tar archive it will maintain executable bits. To fix this you need to change permission on the file to mark it executable. How to do this depends on the type of access you have to tge server. If you have shell (ssh) or ftp access use the chmod comnand. If using cpannel,there should be some dialog in the file manager.

Mediawiki:common.css is not a lua page, so i dont know why you would get lua errors on that page.

I dont know why special:import would need wikibase.


(English) Wikipedia templates can be complex to copy over. It is often less effort to make your own. Sometimes older versions of the template from many years ago are less convoluted and thus easier to copy.

Jonathan3 (talkcontribs)

I definitely wouldn't copy templates from Wikipedia as they're always so complicated. You might get ideas from them though. I also definitely wouldn't use Wikibase or Scribunto/Lua unless you're really confident about that sort of thing. Just draw out on paper what you want your infobox/box of links to look like, and figure out how to implement it. Maybe type it out here and see whether anyone can solve your specific problem rather than general ones that might not need to be solved :-)

DStallTX (talkcontribs)

Yes, I'm thinking the same, that export/import from Wikipedia is overkill for my purposes, and I'd rather KISS to minimize issues.

I think a simple collapsible navbar in box on right side is all I really need, showing index of article series. I'm grouping all my pages into a few series like "Economy" here - https://dstall.com/MOD/index.php/Index_of_economy_articles

There's currently only 2 categories in Economy series (but I might add more) - Agrarianism and Industrialism. Under Industrialism there's currently 5 subcategories - Capitalism, Business, Consumerism, Propaganda, and Science, with sub-subcategories in each of those.

I need to know how to create article series box like on Wikipedia - https://en.wikipedia.org/wiki/Wikipedia:Article_series - with collapsible div boxes, text links, and triangle button (or show/hide link) so I can have expandible/collapsible lists in each box corresponding to subcategories, sub-subcategories in those, etc - however deep that may go.

All I need is to see code sample(s) and I can take it from there. So far, code I've copied from Wikipedia hasn't worked and has just caused issues. I've tried code shown at https://en.wikipedia.org/wiki/Wikipedia:Article_series but that's for Template:History of the United States sidebar. So do I create a Template:Economy sidebar? What code do I enter in it? How do I call it on my Economy page and subpages in Economy series?

Jonathan3 (talkcontribs)

If you really want to keep it simple you could use the CategoryTree extension (which is bundled with core) and use:

{{#categorytree:Economy}}

DStallTX (talkcontribs)

I activated CategoryTree extension in LocalSettings, finally figured out how to define subcategories, and got a menu working.

But I notice that links are to Category pages. Is there any way to link to article pages from Category Tree instead of to Category pages?

I'd rather have div boxes that I can style like the Wikipedia Article Series infobox. Is there a way to do that? - https://en.wikipedia.org/wiki/Wikipedia:Article_series

Jonathan3 (talkcontribs)

The available settings are all here: Extension:CategoryTree.

See also: Manual:Collapsible elements.

There are probably many better ways to do it, but there might be enough here to get you started:

<div style="float: right; width: 400px; background: orange">
<div class="mw-collapsible">
'''Economy'''
<div class="mw-collapsible-content">
[[Agrarianism]] - [[Industrialism]]
</div>
</div>

<div class="mw-collapsible mw-collapsed">
'''Industrialism'''
<div class="mw-collapsible-content">
[[Capitalism]] - [[Business]] - [[Consumerism]] - [[Propaganda]] - [[Science]]
</div>
</div>
</div>
DStallTX (talkcontribs)

I think this could be it. Is there any reason it won't work? It's nothing but a list with CSS. Scroll down to Tree Menu Demo - https://code-boxx.com/css-collapsible-tree-menu/ I guess it all depends on what's allowd - HTML restriction

Would be nice if php could populate the list with categories, and build page links instead of category links. Place code in template, then call navbar template on each page (just like php include).

I just tested it; input type and label tags don't work - https://dstall.com/MOD/index.php/Government

DStallTX (talkcontribs)

That doesn't make sense. Economy category opens with 2 subcategories Agrarianism and Industrialism, but then the Industrialism subcategory is repeated as a category equal to Economy?

Is there no way to redirect Category links in Category Tree to article pages instead of category pages?

I'm looking for a nav menu that's like the Category Tree, but links to pages, and has an active function that opens tree to current page.

For example, on Foreign Policy page, https://dstall.com/MOD/index.php/Foreign_Policy - the page should load with nav menu subcategory "Military" open to reveal "Foreign Policy" which would be active https://www.w3schools.com/html/html_links_colors.asp - with link, visited and hover functions as well.

Search for "result" on this page - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

Could template be constructed (like php include) that would load nav menu in div? How do you code it so it knows when to make link a:active?

Bawolff (talkcontribs)

You can use Manual:Collapsible elements instead of the details thing from mdn.

> How do you code it so it knows when to make link a:active?

I'm not sure i understand what you are trying to do here. a:active is css syntax to mean a link that is currently being clicked.


For category tree use mode=pages e.g. <categorytree mode="pages">Economy</categorytree>

DStallTX (talkcontribs)

That code produces entire category tree (Economy with Agrarianism and Industrialism subcategories) just as does other code -#categorytree:Humanity - enclosed by double braces,

as well as an Economy stand alone link beneath the tree.

Only the standalone Economy link connects to Economy page. Category tree links connect to category pages just like code with braces.

I want the entire category tree (not just single link) and every link in the tree to link to pages not category pages.

I know a:active is css syntax, and am wondering if there's a way to produce a page tree in html like a navbar menu that can have all the usual nav attributes. It could be created as a template so it only has to be edited once when new pages are added to the category, and not updated on every page.

Or maybe more simply, if there's simply a way to force all links in category tree to pages instead of category pages, . . .

and to force tree to open to current page - such as my Business page would force Economy tree to open not just to 2 subcategories (Agrarianism and Industrialism) but would force Industrialism to show its subcategories - Business, Capitalism, Consumerism, Propaganda, Science.

Larrydberg (talkcontribs)

Quick side comment on lua binary executableness: My wiki is hosted at Godaddy where Installatron is used for version maintenance. Whenever Installatron does an upgrade, the execute bit in the lua binaries is not set: extensions/Scribunto/includes/engines/LuaStandalone/binaries/*/lua

I have long since given up trying to get this fixed, and manually chmod this bit whenever I do an upgrade. So it's possible that you're getting the lua error message just by using lua, independent of everything else.

Reply to "How to create article series?"