Jump to content
  • 0

SMW questions and help


hishutup

Question

I created this template which is very much unfinished because I always wanted to give it a shot and I figured this may be a good time.

I don't know about you but this is very complex and my poor variable naming skills are really shining.

 

I want what you think. Is there a way to optimize some of the code. There are parts that can be broken off into other templates like the list thing. Now come to think of it, I think it should.

 

This should for any of the guides that are out there. If there is something specific that you want then I'll add it but right now my brain hurts because of this mess.

 

I'm not going to rip out code so that the template become more generic because I developed it for myself, I will add though. I can make another one if it desired

 

Soon to come:

My mod install procedure.

variable header tags.

Link to comment
Share on other sites

  • Answers 175
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

  • 0

 

 

The first question is, what are you trying to accomplish exactly?

 

I am trying to get multiple mods that can be queried via [[Category:TES4Mod]] to be handled similar to the way adding mods in packs are done.

apWMHheYRQIZ

 

The [[Category:TES4Mod]] is done using a #ifeq parser function so that it compare the {{PAGENAME}} and "Dev:TES4Mod/{{{Title}}}" and this seems to give me the effect that I wanted which is to be able to embed a mod but not embed the [[Category:TES4Mod]] on the page which the mod page is embedded.

The mod data is stored on "Dev:TES4Mod\<Mod Name>". 

 


 

 

 

If all you want to do is include two different templates, it's just a matter of defining a new "for template" call.

 

I know I could do that but the number of mods to be added is not defined.

 


 

 

I also noticed that on some of your test template pages you are providing an example display of the contents. That is not good to do when you are using SMW properties, as your template pages end up with SMW data which is undesirable. If you want to provide an example output, it is better to add logic to handle dummy displays. Such as calling the template with no arguments, or passing an argument like "debug" or "test" to indicate you only want to provide an example output and not set SMW properties.

 

 

I could incorporate the same thing I did for the [[Category:TES4Mod]], so that the SMW data will only work when the {{PAGENAME}} is equal to "Dev:TES4Mod\<Mod Name>".

Link to comment
Share on other sites

  • 0

Use {{FULLPAGENAME}} as that includes the namespace. That is likely the reason there are bogus links and data showing up in SMW, because {{PAGENAME}} does not include the namespace.

 

The next question is, do you have everything related to the Mod pages setup the way you want? Throwing in a multiple instance template into the mix before the underlying pieces are done is not wise.

 

The Pack implementation is a bad example, so I wouldn't follow it. You definitely want a multiple instance template, but you don't want to imbed it in another template.

 

In it's simplest form, you would do something like this.

{{{for template|TES4ModList|multiple}}}
{{{field|modName|mandatory|input type=combobox|values from category=TES4Mod|existing values only}}}
{{{end template}}}

Then you would create Template:TES4ModList and use that to display data from the Mod page.

{{#show:[[modName]]|?OblivionModUrl}}
{{#show:[[modName]]|?Author}}
Link to comment
Share on other sites

  • 0

 

Use {{FULLPAGENAME}} as that includes the namespace. That is likely the reason there are bogus links and data showing up in SMW, because {{PAGENAME}} does not include the namespace.

 

I put {{PAGENAME}} on one of the Mod pages and it resulted in Dev:TES4Mod/<mod title>

 

I think this issue comes from when you re-enabled the Dev: namespace.

Because there used to be pages on the page Dev:TES4Mod/<mod title> and then when you re-enabled the Dev: namespace the {{PAGENAME}} were still on the Dev:TES4Mod/<mod title> verses TES4Mod/<mod title>

 

 

 

The next question is, do you have everything related to the Mod pages setup the way you want? 

No, I am learning. I am trying out various things to see how they work. I'll end up deleting all my pages and then redo it because right now I am not happy with the names and the way things are set up.

 

 

In it's simplest form, you would do something like this.

{{{for template|TES4ModList|multiple}}}

{{{field|modName|mandatory|input type=combobox|values from category=TES4Mod|existing values only}}}

{{{end template}}}

Then you would create Template:TES4ModList and use that to display data from the Mod page.

{{#show:[[modName]]|?OblivionModUrl}}

{{#show:[[modName]]|?Author}}

 

oh, this is interesting, thank you.

Link to comment
Share on other sites

  • 0

Again ... I REALLY think we should be setting up a separate dev wiki entirely before hishutup experiments too much more ... Too much to break and interfere with. It whould be OK if done in such a way as to not cross-contaminate existing SMW structures, but that is always a possibility when one is developing on the live wiki and using existing SMW structures as a starting point.

 

@hishutup

You can always install MW inside a VM on your local machine and practice in that sandbox. This is what s4n and I have been doing for awhile now. At least until we get a dev wiki instance up.

Link to comment
Share on other sites

  • 0

 

 

Again ... I REALLY think we should be setting up a separate dev wiki entirely before hishutup experiments too much more ... Too much to break and interfere with. It whould be OK if done in such a way as to not cross-contaminate existing SMW structures, but that is always a possibility when one is developing on the live wiki and using existing SMW structures as a starting point.

I 100% agree with pretty much everything other than the cross contamination part because I am using some prefixes like Oblivion and TES4 but I see the reasons.

I have already broken the wiki a couple of times in one way or another :/

Like the two bogus pages here

 

 

You can always install MW inside a VM on your local machine and practice in that sandbox. This is what s4n and I have been doing for awhile now. At least until we get a dev wiki instance up.

You can always install MW inside a VM on your local machine and practice in that sandbox. This is what s4n and I have been doing for awhile now. At least until we get a dev wiki instance up.

I understand VM and the functions but I have zero idea how to do it for mediawiki. I don't know anything about managing a wiki either. 

I can already see issues happening with some differences between a VM and the current wiki.

EDIT: But then again it might not be bad to learn how to run a wiki :/

Link to comment
Share on other sites

  • 0

I put {{PAGENAME}} on one of the Mod pages and it resulted in Dev:TES4Mod/<mod title>

 

I think this issue comes from when you re-enabled the Dev: namespace.

Because there used to be pages on the page Dev:TES4Mod/<mod title> and then when you re-enabled the Dev: namespace the {{PAGENAME}} were still on the Dev:TES4Mod/<mod title> verses TES4Mod/<mod title>

 

No, I moved the pages that were on Dev:TES4Mod/* into the namespace. {{PAGENAME}} would have worked before because of the fact that Dev: was not a namespace. Now that it is, it will show TES4Mod. Refer to this.

 

I also agree that we need to get a dev wiki up soon. The live Wiki isn't a good learning ground.

Link to comment
Share on other sites

  • 0

No, I moved the pages that were on Dev:TES4Mod/* into the namespace. {{PAGENAME}} would have worked before because of the fact that Dev: was not a namespace. Now that it is, it will show TES4Mod. Refer to this.

 

I guess I made a mistake from post #63 by accidentally incorporating the namespace when it actually isn't part of the equation.

I figured something was fishy from the start because everything works as I intended. I guess I was defending my own mistake, sorry about that.

Here is the line for most of the SMW data.

{{#ifeq: {{PAGENAME}}|TES4Mod/{{{Title}}}|[[OblivionModTitle::{{{Title}}}| ]]
[[OblivionColor::{{{Color}}}| ]][[OblivionModPage::{{FULLPAGENAME}}| ]][[OblivionModUrl::{{{Link}}}| ]]|}}

I could use "{{FULLPAGENAME}}|Dev:TES4Mod/{{{Title}}}" but I don't see a reason to include that and again, sorry about that.

Link to comment
Share on other sites

  • 0

@hishutup

Actually, I don't want to drive a wedge into your creativity ... just had scary thoughts that we would have some guide downtime or other funky stuff going on that would require one of us going in and running maintenance tasks to fix stuff. Your work probably is not going to adversely affect anything else as long as you don't accidentally use any Properties that we already have in place (you can see what is currently in use in SpecialPages). Just keep learning as you see fit. It is not easy to work with and debugging SMW, since there are lots of moving parts (especially on the prod wiki).

 

@s4n

Yeah, a dev wiki at least would provide a clean slate and debugging SMW code would probably be much simpler. The dev wiki would probably also be more responsive Semantically speaking. Maybe you could throw up a dev wiki env with latest MW/SMW software when you do the site update? I can flesh out a Portal with some "getting started" info if you do.

Link to comment
Share on other sites

  • 0

Z, like I said I completely understand and that is why I use those specific prefixes for just about everything that I create.. I know that there are various things that can cause some pretty major issues. You may want to also lock down some of the pack templates and whatnot because anyone can edit them, I thought I should let you know about that. 

 

SMW has the most moving parts out of the languages that I have some experience on.

 

I am not a creative person, I am just curious about SMW and like to see how things work. I tend to find the simplest things to be interesting.

 

If I am doing something wrong, just shoot me a message on this topic or a pm. I rather not completely destroy the wiki.

 

 

EDIT: Another thing, do any of you actually look at the Template:Delete?

Link to comment
Share on other sites

  • 0

That template was created by Farlo and copied from the GuildWars wiki ... He was the only one of us that really had experience as a wiki editor before we launched this site. Much of what he developed, he grabbed from GW or MW, and he was the first person interested in SMW. S4n built most of our current SMW, since he picked it up faster than the rest of us, but Farlo's wiki skills were good enough to help him figure out how to use s4n's stuff to build the current beta Pack structure. I am still only an apprentice to these journeymen ;)

Link to comment
Share on other sites

  • 0

I know that s4n said that links cannot be parsed with a URL property using a media wiki markup or html but this is kind of of a different scenario.

 

As I was moving some more mods over to work with, I had a like which I want to copy over but the property OblivionNotes does not like it.

Here is the Mod Page and I was tying to pass [https://www.nexusmods.com/oblivion/mods/18498/? Here.] but I got various errors.

 

Is there anyway to keep the SMW property and allow link to be parsed correctly or would I have to figure out a different way to handle "related links"?

 

I hope I used the correct terminology,

Link to comment
Share on other sites

  • 0

I guess I made a mistake from post #63 by accidentally incorporating the namespace when it actually isn't part of the equation.

I figured something was fishy from the start because everything works as I intended. I guess I was defending my own mistake, sorry about that.

Here is the line for most of the SMW data.

{{#ifeq: {{PAGENAME}}|TES4Mod/{{{Title}}}|[[OblivionModTitle::{{{Title}}}| ]]
[[OblivionColor::{{{Color}}}| ]][[OblivionModPage::{{FULLPAGENAME}}| ]][[OblivionModUrl::{{{Link}}}| ]]|}}

I could use "{{FULLPAGENAME}}|Dev:TES4Mod/{{{Title}}}" but I don't see a reason to include that and again, sorry about that.

I had changed the template to use {{FULLPAGENAME}} when setting OblivionModPage. The use of {{PAGENAME}} in the ifeq parser function is correct.

Link to comment
Share on other sites

  • 0

I know that s4n said that links cannot be parsed with a URL property using a media wiki markup or html but this is kind of of a different scenario.

 

As I was moving some more mods over to work with, I had a like which I want to copy over but the property OblivionNotes does not like it.

Here is the Mod Page and I was tying to pass [https://www.nexusmods.com/oblivion/mods/18498/? Here.] but I got various errors.

 

Is there anyway to keep the SMW property and allow link to be parsed correctly or would I have to figure out a different way to handle "related links"?

 

I hope I used the correct terminology,

You are using a wiki-type link here ... is this a typo? Trying to trace where you are passing the URL

 

EDIT: Nevermind, I see what you are doing now ... I tried to experiment with square brackets called via template, but that was useless. Then I tried using the HTML char codes, which is closer, but it does not get parsed correctly as wiki markup. The answer lies along these paths though, I suppose (if solvable). You may want to try either using the template forms of L/R square brackets that I just created or the char codes in your template or try magic words. ...s4n?

 

Anyway, I see a question mark in the URL. This can be problematic (along with other special characters when passed as HTML ... I think). Anyway, I am not privy to correct terminology as to what/why certain chars do not work in certain situations (s4n can explain it), but I have learned to resolve using magic words on an ad-hoc basis. Look at magic words help and see in particular the section on URL data. This has helped me to resolve certain URL issues when passed through templates in our implementation.

Link to comment
Share on other sites

  • 0

Using Wiki markup to send a URL into a template works. It's assigning it to an SMW property that will break. It's not supported, and interferes with SMW markup.

 

To begin with, SMW is not meant to store pre-formated text, which is what you are trying to do. A limited amount of wiki markup works which will get parsed appropriately. Using the set parser function is your only safe bet instead of the normal [[Property::Value]] method.

{{#set:OblivionNotes={{{notes}}}}}

DO NOT use the set parser function to attempt to set a URL Property using wiki markup.

Link to comment
Share on other sites

  • 0

 

 

DO NOT use the set parser function to attempt to set a URL Property using wiki markup.

Since you said do not do it, I have to ask, what i the problem with using the #set to set a URL property.

 

Does it just make a string of text become a link to a URL value of text that it is being set to?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.