qwaletee, I hope you don't mind I moved your post from WME Chat to here where I think it is more applicable.
qwaletee wrote:However, I think as kent implemented it, the usage is fairly awkward, so I went ahead and rewrote it with a bunch of options. It will still support EXACTLY THE SAME SYNTAX as Kent provided, with some mild formatting changes to the result, but also supports a lot more.
Actually you did change some of the function originally implemented, so I did fix that already. In the future we should probably consider making major changes like this to a parallel template and review it before making the changes on the live templates just in case.
qwaletee wrote:1) As originally implemented, you either link to the default Wiki updates forum main page, or specify a forum name. But if you specify the name, it doesn't really link anywhere. I set it up so it will now search the Wiki Update forum for a topic with the specified name
That is incorrect. I was very clear in the original instructions that the parameter "forum=URL" required a URL and even provided an example. If you entered a forum name, I actually have no idea what it would have tried to do with that since that was not the intended operation.
qwaletee wrote:2) As originally implemented, you had to know the template's internal syntax of "forum=text" to invoke the alternate topic name I mentioned in the previous point. I simplified it so that you can give the text as a nameless parameter. {{ForumLink | Any text to search topic name}}
This is an interesting idea to allow an editor to link to the forum with a text search parameter. I am OK with using an unnamed parameter for this particular variable if we expect this to be a common use of the template. However I am not sure where we would even use that situation. Maybe I just have not thought it through.
qwaletee wrote:3) Instead of specifying the text of the topic name, you can specify a topic ID {{ForumLink | 89344}} would link to the topic we are in now...
What if you wanted to search for 89344? Using unnamed parameters makes this very difficult.
qwaletee wrote:4) ...but using generic text for the link. Instead, you can specify both text and ID: {{ForumLink | New WME chat Wiki page | 89344}} - this will link here using the specified text. Note that 89344 can be easily found in the URL while you are reading the topic (after the &t= in the address bar).
I believe you have the code automatically determine if the numeric ID is first or last so the user does not need to know what order. That is good (assuming they never want to search for a number).
qwaletee wrote:5) Some pages may need to link to a different forum. For example, the state pages pages might link to the state forums instead of the Wiki updates forum. The syntax here is a little more convoluted -- just add forumid=nnn, where nnn matches the forum ID, which can be found in URLs for any page in that forum (after &f= in the address bar). For example, the
NJ forumid=249, so {{ForumLink|forumid=249}} (default link text) or {{ForumLink|Go to New Jersey's forum, guys!|forumid=249}} (specified link text) will work
I am not sure how all this is easier or less awkward than simply cut and pasting the intended URL of the target thread.
qwaletee wrote:
6) The above won't work for the country forums, because the URL changes for each country. An additional parameter is available to support the other countries: |lang=aa - for example {{ForumLink | Can you read Hebrew? | 23238 | forumid=59}}
Again, a cut and paste of the actual URL is a lot easier.
qwaletee wrote:
FYI, I kept Kent's original parameter of "|forum=any-url-you-want" out of deference to him and so as not to break any pages he was working on. But honestly, it is confusing, as it goes to any page, not just a forum, and you have to use the whole URL. If he's OK with it, I'd like to drop it and use a different name. Since you don't have to use forum= (because I support nameless parameters), please don't specify forum= if you can possibly avoid it. It will make it easier to rip out later.
Since you are recommending we use this template to do multiple things, I believe we can have the template determine if the field is a URL and if so then it can process appropriately. Then only the more complex combinations you noted would use a named parameter.
Was your concern that because you could use any URL that someone could erroneously link people to something other than our forum? I was not concerned about that level of error checking.