Hi
I have been using MediaWiki for a couple of years now and have recently gone more in depth with it for various projects. One of them is gamewiki.net and there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have searched and read everything I could find on templates and advanced templates and so far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is avaialbe on windows only, on linux, or on Xbox, or on multiple ones. To auto include categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something like calling the Infobox template with "platform = Windows, Linux, Xbox" and then extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to users.
The same trouble I face with developers and publishers. Sometimes a game has more than one developer (be it for a porting project or simply cooperation). I could just make "developer1 = company A" and "developer2 = company B" but that is again a pretty ugly solution which would be a lot cleaner if the way mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse even, the games then get released a few days, or even months apart for different regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am currently at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris
Hi Chris,
You'll probably want to look into the ParserFunctions, StringFunctions and LoopFunctions extensions. These add more looping/parsing capabilities to the parser for doing those kinds of complex operations.
-- Jim R. Wilson (jimbojw)
On Wed, May 21, 2008 at 10:46 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi
I have been using MediaWiki for a couple of years now and have recently gone more in depth with it for various projects. One of them is gamewiki.net and there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have searched and read everything I could find on templates and advanced templates and so far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is avaialbe on windows only, on linux, or on Xbox, or on multiple ones. To auto include categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something like calling the Infobox template with "platform = Windows, Linux, Xbox" and then extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to users.
The same trouble I face with developers and publishers. Sometimes a game has more than one developer (be it for a porting project or simply cooperation). I could just make "developer1 = company A" and "developer2 = company B" but that is again a pretty ugly solution which would be a lot cleaner if the way mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse even, the games then get released a few days, or even months apart for different regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am currently at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hi Jim
Thanks for the speedy answer. I am already using parserfunctions extension and stumbled across the string functions once (although that one did not have what I needed). So far I did not see the loop functions, but that would actually fit all together the profile very well. And if it doesn't fit perfect, I could make it work with the code available, I'd think.
If I get this working I will post back so anyone else running into this can find the solution easy.
My organizational problems still remain though. Any input will be very welcome.
Greetings, Chris
On Wed, May 21, 2008 at 10:38 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
Hi Chris,
You'll probably want to look into the ParserFunctions, StringFunctions and LoopFunctions extensions. These add more looping/parsing capabilities to the parser for doing those kinds of complex operations.
-- Jim R. Wilson (jimbojw)
On Wed, May 21, 2008 at 10:46 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi
I have been using MediaWiki for a couple of years now and have recently
gone
more in depth with it for various projects. One of them is gamewiki.netand there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have
searched
and read everything I could find on templates and advanced templates and
so
far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is
avaialbe
on windows only, on linux, or on Xbox, or on multiple ones. To auto
include
categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something
like
calling the Infobox template with "platform = Windows, Linux, Xbox" and
then
extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to
users.
The same trouble I face with developers and publishers. Sometimes a game
has
more than one developer (be it for a porting project or simply
cooperation).
I could just make "developer1 = company A" and "developer2 = company B"
but
that is again a pretty ugly solution which would be a lot cleaner if the
way
mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse
even,
the games then get released a few days, or even months apart for
different
regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am
currently
at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
I have investigated this further. The string and loop functions are all very nice, but unfortunately useless for my purposes.
The reason is something awfully simple. When using a loop, the content of what is to be looped is evaluated first and then looped. So using anything inside that loop will not work, if it requires calling a template or anything else.
So now I am making a small extension for doing what I need to do. Once it is done, I will release it on MediaWiki.org. I have a preliminary version going but it still has bugs.
- Chris
On Wed, May 21, 2008 at 10:53 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi Jim
Thanks for the speedy answer. I am already using parserfunctions extension and stumbled across the string functions once (although that one did not have what I needed). So far I did not see the loop functions, but that would actually fit all together the profile very well. And if it doesn't fit perfect, I could make it work with the code available, I'd think.
If I get this working I will post back so anyone else running into this can find the solution easy.
My organizational problems still remain though. Any input will be very welcome.
Greetings, Chris
On Wed, May 21, 2008 at 10:38 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
Hi Chris,
You'll probably want to look into the ParserFunctions, StringFunctions and LoopFunctions extensions. These add more looping/parsing capabilities to the parser for doing those kinds of complex operations.
-- Jim R. Wilson (jimbojw)
On Wed, May 21, 2008 at 10:46 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi
I have been using MediaWiki for a couple of years now and have recently gone more in depth with it for various projects. One of them is gamewiki.net and there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have searched and read everything I could find on templates and advanced templates and so far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is avaialbe on windows only, on linux, or on Xbox, or on multiple ones. To auto include categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something like calling the Infobox template with "platform = Windows, Linux, Xbox" and then extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to users.
The same trouble I face with developers and publishers. Sometimes a game has more than one developer (be it for a porting project or simply cooperation). I could just make "developer1 = company A" and "developer2 = company B" but that is again a pretty ugly solution which would be a lot cleaner if the way mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse even, the games then get released a few days, or even months apart for different regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am currently at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
One other option available to you is my RegexParserFunctions Extension[1], which can be used to perform regular expression replacement on a given input. So in your example, you could replace each instance of a comma followed by whitespace with the appropriate separator, such as "]][[". It's a bit more complicated than simple looping kinds of things, so I figured I'd point you to StringFunctions and LoopFunctions first in case they were sufficient to do what you wanted.
[1] http://www.mediawiki.org/wiki/Extension:RegexParserFunctions
-- Jim
On Sat, May 24, 2008 at 1:00 PM, Chris Riesen chris.riesen@gmail.com wrote:
I have investigated this further. The string and loop functions are all very nice, but unfortunately useless for my purposes.
The reason is something awfully simple. When using a loop, the content of what is to be looped is evaluated first and then looped. So using anything inside that loop will not work, if it requires calling a template or anything else.
So now I am making a small extension for doing what I need to do. Once it is done, I will release it on MediaWiki.org. I have a preliminary version going but it still has bugs.
- Chris
On Wed, May 21, 2008 at 10:53 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi Jim
Thanks for the speedy answer. I am already using parserfunctions extension and stumbled across the string functions once (although that one did not have what I needed). So far I did not see the loop functions, but that would actually fit all together the profile very well. And if it doesn't fit perfect, I could make it work with the code available, I'd think.
If I get this working I will post back so anyone else running into this can find the solution easy.
My organizational problems still remain though. Any input will be very welcome.
Greetings, Chris
On Wed, May 21, 2008 at 10:38 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
Hi Chris,
You'll probably want to look into the ParserFunctions, StringFunctions and LoopFunctions extensions. These add more looping/parsing capabilities to the parser for doing those kinds of complex operations.
-- Jim R. Wilson (jimbojw)
On Wed, May 21, 2008 at 10:46 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi
I have been using MediaWiki for a couple of years now and have recently gone more in depth with it for various projects. One of them is gamewiki.net and there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have searched and read everything I could find on templates and advanced templates and so far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is avaialbe on windows only, on linux, or on Xbox, or on multiple ones. To auto include categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something like calling the Infobox template with "platform = Windows, Linux, Xbox" and then extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to users.
The same trouble I face with developers and publishers. Sometimes a game has more than one developer (be it for a porting project or simply cooperation). I could just make "developer1 = company A" and "developer2 = company B" but that is again a pretty ugly solution which would be a lot cleaner if the way mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse even, the games then get released a few days, or even months apart for different regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am currently at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
If you've never used regex before you should probably have a look at this site: http://www.regular-expressions.info/
Trying to be helpful :-), CWii
Jim R. Wilson wrote:
One other option available to you is my RegexParserFunctions Extension[1], which can be used to perform regular expression replacement on a given input. So in your example, you could replace each instance of a comma followed by whitespace with the appropriate separator, such as "]][[". It's a bit more complicated than simple looping kinds of things, so I figured I'd point you to StringFunctions and LoopFunctions first in case they were sufficient to do what you wanted.
[1] http://www.mediawiki.org/wiki/Extension:RegexParserFunctions
-- Jim
On Sat, May 24, 2008 at 1:00 PM, Chris Riesen chris.riesen@gmail.com wrote:
I have investigated this further. The string and loop functions are all very nice, but unfortunately useless for my purposes.
The reason is something awfully simple. When using a loop, the content of what is to be looped is evaluated first and then looped. So using anything inside that loop will not work, if it requires calling a template or anything else.
So now I am making a small extension for doing what I need to do. Once it is done, I will release it on MediaWiki.org. I have a preliminary version going but it still has bugs.
- Chris
On Wed, May 21, 2008 at 10:53 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi Jim
Thanks for the speedy answer. I am already using parserfunctions extension and stumbled across the string functions once (although that one did not have what I needed). So far I did not see the loop functions, but that would actually fit all together the profile very well. And if it doesn't fit perfect, I could make it work with the code available, I'd think.
If I get this working I will post back so anyone else running into this can find the solution easy.
My organizational problems still remain though. Any input will be very welcome.
Greetings, Chris
On Wed, May 21, 2008 at 10:38 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
Hi Chris,
You'll probably want to look into the ParserFunctions, StringFunctions and LoopFunctions extensions. These add more looping/parsing capabilities to the parser for doing those kinds of complex operations.
-- Jim R. Wilson (jimbojw)
On Wed, May 21, 2008 at 10:46 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi
I have been using MediaWiki for a couple of years now and have recently gone more in depth with it for various projects. One of them is gamewiki.net and there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have searched and read everything I could find on templates and advanced templates and so far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is avaialbe on windows only, on linux, or on Xbox, or on multiple ones. To auto include categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something like calling the Infobox template with "platform = Windows, Linux, Xbox" and then extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to users.
The same trouble I face with developers and publishers. Sometimes a game has more than one developer (be it for a porting project or simply cooperation). I could just make "developer1 = company A" and "developer2 = company B" but that is again a pretty ugly solution which would be a lot cleaner if the way mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse even, the games then get released a few days, or even months apart for different regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am currently at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
You can also poke me into working on WikiCode, and perhaps Tim into helping find a way to let ParserFunctions access their parent template frame. Theoretically I can get a new type of LoopFunctions in WikiCode which actually allows nested ParserFunctions. Plus one of the planned functions is #splitandmerge, which is perfect for these cases where you are trying to split up a comma separated list and format it. In fact, that's the primary purpose for it.
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
John wrote:
If you've never used regex before you should probably have a look at this site: http://www.regular-expressions.info/
Trying to be helpful :-), CWii
Jim R. Wilson wrote:
One other option available to you is my RegexParserFunctions Extension[1], which can be used to perform regular expression replacement on a given input. So in your example, you could replace each instance of a comma followed by whitespace with the appropriate separator, such as "]][[". It's a bit more complicated than simple looping kinds of things, so I figured I'd point you to StringFunctions and LoopFunctions first in case they were sufficient to do what you wanted.
[1] http://www.mediawiki.org/wiki/Extension:RegexParserFunctions
-- Jim
On Sat, May 24, 2008 at 1:00 PM, Chris Riesen chris.riesen@gmail.com wrote:
I have investigated this further. The string and loop functions are all very nice, but unfortunately useless for my purposes.
The reason is something awfully simple. When using a loop, the content of what is to be looped is evaluated first and then looped. So using anything inside that loop will not work, if it requires calling a template or anything else.
So now I am making a small extension for doing what I need to do. Once it is done, I will release it on MediaWiki.org. I have a preliminary version going but it still has bugs.
- Chris
On Wed, May 21, 2008 at 10:53 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi Jim
Thanks for the speedy answer. I am already using parserfunctions extension and stumbled across the string functions once (although that one did not have what I needed). So far I did not see the loop functions, but that would actually fit all together the profile very well. And if it doesn't fit perfect, I could make it work with the code available, I'd think.
If I get this working I will post back so anyone else running into this can find the solution easy.
My organizational problems still remain though. Any input will be very welcome.
Greetings, Chris
On Wed, May 21, 2008 at 10:38 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
Hi Chris,
You'll probably want to look into the ParserFunctions, StringFunctions and LoopFunctions extensions. These add more looping/parsing capabilities to the parser for doing those kinds of complex operations.
-- Jim R. Wilson (jimbojw)
On Wed, May 21, 2008 at 10:46 AM, Chris Riesen chris.riesen@gmail.com wrote:
Hi
I have been using MediaWiki for a couple of years now and have recently gone more in depth with it for various projects. One of them is gamewiki.net and there I am currently having a problem.
http://gamewiki.net/Template:Infobox_Game
This little template is giving me a few headaches and I hope some experienced people can give me a few hints and pointers, as I have searched and read everything I could find on templates and advanced templates and so far have not found a solution for this little problem of mine.
Right now, I have a field "platform" that describes if the game is avaialbe on windows only, on linux, or on Xbox, or on multiple ones. To auto include categories etc, I chose to create templates like {{Platform Xbox}} and {{Platform Windows}}. I could make that into a smaller one, like {{Platform|Windows}} and then have a switch in the platform template, but that is still not very elegant. What I wanted to achieve is something like calling the Infobox template with "platform = Windows, Linux, Xbox" and then extract from that what I need, maybe translate it internally into a {{Platform|Windows}} template. The goal is to make it easy to use to users.
The same trouble I face with developers and publishers. Sometimes a game has more than one developer (be it for a porting project or simply cooperation). I could just make "developer1 = company A" and "developer2 = company B" but that is again a pretty ugly solution which would be a lot cleaner if the way mentioned above could be used somehow.
That said, the problems compound here in this box. For one, there are different release dates for different platforms. Say Assassins Creed was released last year for the consoles and this year for Windows. Worse even, the games then get released a few days, or even months apart for different regions. Anyone has an idea how I could handle that gracefully?
I don't shy away from extensions or even making my own, but I am currently at a loss how I should attack this problem.
Thanks a lot in advance to anyone giving some insight into this problem.
Greetings, Chris _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org