Module talk:TrainingPages
Wikipedia:Training/For students/Editing topics
Wikipedia:Training/For students/Getting started 1
Wikipedia:Training/For students/Citing sources 2
---
Wikipedia:Training/header
Wikipedia:Training/For students/Text editing
Wikipedia:Training/For students/Discussion
---
Wikipedia:Training/For students/Sandbox edits for new articles
---
Module:TrainingPages error (index parameter):failed to access mw.title.new(Wikipedia:Training/For students/Nonexistent index):getContent() to load the index data
--
Wikipedia:Training/For students/valuable contribution
--
14
-- calling with redirects issue (invoke with "project" in index and page): Wikipedia:Training/For students/Citing sources 2
Wikipedia:Training/For students/Citing sources
(invoke with "project" in index location only): Wikipedia:Training/For students/Citing sources 2
script error on template page
I've started using this for an updated navigation framing for the trainings. It's working on the pages themselves, but it gives script errors on the template page: Wikipedia:Training/header/draft. It seems to be related to how the module treats "index=[nothing]".--Sage Ross (WMF) (talk) 15:31, 8 April 2013 (UTC)
- Sorry, I wasn't paying attention to this page! The problem right now is that the module is trying to look up an index file [[Wikipedia:Training/header/{{{topic}}} index]], and it doesn't exist. I've modified the message slightly, but I don't see a way to avoid having some kind of error if the module doesn't know what to use for an index page. Wnt (talk) 03:31, 25 April 2013 (UTC)
- OK, I've made it so that it returns a text-based message which is hopefully a little bit comprehensible. Or you can set noerr = (nonblank value) to have it return nothing if there's an error, for neatness. Wnt (talk) 03:51, 25 April 2013 (UTC)
- Excellent.--Sage Ross (WMF) (talk) 15:22, 25 April 2013 (UTC)
feature request: get_page by number
It'd be handy if this had a function to return the name of page X (eg, the first page) given an index.--Sage Ross (WMF) (talk) 22:39, 8 April 2013 (UTC)
- OK, I've jury-rigged it so that if "page" is a number (i.e. tonumber() gives a true result) it is interpreted directly as a page number. Used with function main this returns the name of the page with a given number. It also stacks with next_page or displacement to return other pages or the default page as appropriate for the displacement. Wnt (talk) 04:13, 25 April 2013 (UTC)
new bug: total_pages not working correctly
Now total_pages is working incorrectly. For example:
{{#invoke:TrainingPages|total_pages|index=Wikipedia:Training/For students/The Core index }}
yields: 14
The expected value is 15: Wikipedia:Training/For students/The Core index.
When used in the context of a page on that index, it is now returning the same value as page_number rather than the actual total pages. See Wikipedia:Training/For students/No original research.--Sage Ross (WMF) (talk) 15:22, 25 April 2013 (UTC)
- I've fixed it, but I'm not clear whether setting "returnpage" was the right thing for when total_pages catches an error.--Sage Ross (WMF) (talk) 15:28, 25 April 2013 (UTC)
- Oh, phooey - not sure why I did that but it looks like you caught it. Sigh... writing unit tests is not a great pleasure for me but it looks like I'm well past the point where it was needed! Wnt (talk) 15:36, 25 April 2013 (UTC)
- OK, testcases at Module talk:TrainingPages/testcases. Hopefully if I foul something else up I'll notice now. :) Wnt (talk) 16:27, 25 April 2013 (UTC)
request: allow use of namespace synonyms in index pages
I've been working on making it easier to port the trainings to other wikis (starting with moving them to Meta where it will be possible to use the translate extension). With most of the templates and content, I can change page names in the Wikipedia: namespace to "Project:" so that they will work the same no matter which wiki they are on. But the index pages used by this module only work if the local name of the Project: namespace is used. (So on meta, after I imported all the training pages I had to change the index pages to refer to Meta:, and they will have to be changed again by anyone porting them to other wikis.)
I would be very handy if the module could recognize that Wikipedia:Training is the same as Project:Training, and work the same with either.--Sage Ross (WMF) (talk) 16:38, 6 June 2013 (UTC)