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

So {{User:MyTemplate}} calls a template I set up on [[user:MyTemplate]]?

 

Is same true for Forms and properties?

I describe what happens in this post. The above would need to be {{User:Z929669/MyTemplate}}. It is not true for Properties and Forms, they still need to reside in the Property: and Form: namespaces.

 

For templates, the namespace is the key. If the call doesn't include a valid namespace, then it is assumed to be the Template: namespace.

 

EDIT: hishutup :ninja:  me

 

EDIT 2: Also, to prevent the wiki from assuming the Template: namespace, you can put a leading colon in the template call like {{:MyTemplate}}. That would then transclude the MyTemplate page in the Main namespace.

Link to comment
Share on other sites

  • 0

Then moving Templates related to SMW doesn't seem necessary if related Form and Properties still reside in their own namespaces. Makes sense to let the relevant Templates reside in the native namespace in relation to all constructs other than pages that are built using them ... those could more neatly reside under Dev namespace.

 

However, these dev 'source' and 'sink' pages cannot really be quarantined effectively unless they all can reside under the Dev: namespace. Makes more sense to launch an entirely different dev wiki under its own subdomain, which we really should do anyway so that users like hishutup (and us) can go crazy without any worry about breaking or confounding anything.

Link to comment
Share on other sites

  • 0

what caused the rouge property?

What do you mean clean up?

Did you delete the pages or stuff in the background that is on the server?

I'm not sure what caused the rouge property, and there were some other properties that needed to be cleaned up that weren't. The cleanup involved deleting all SMW data and rebuilding it. No pages were deleted.

Link to comment
Share on other sites

  • 0

Then moving Templates related to SMW doesn't seem necessary if related Form and Properties still reside in their own namespaces. Makes sense to let the relevant Templates reside in the native namespace in relation to all constructs other than pages that are built using them ... those could more neatly reside under Dev namespace.

 

However, these dev 'source' and 'sink' pages cannot really be quarantined effectively unless they all can reside under the Dev: namespace. Makes more sense to launch an entirely different dev wiki under its own subdomain, which we really should do anyway so that users like hishutup (and us) can go crazy without any worry about breaking or confounding anything.

They have nothing to do with each other (Templates versus SMW Forms and Properties). It doesn't matter if templates reside in the Template: namespace or on some other page, it in no way breaks association.

 

 

 

PRO

Placing templates in the Dev: namespace during development would not be searchable by default. The Template: namespace is searchable by default, Form: Property: and Dev: are not.

 

CON

Forms would need to be updated when a template is made live by putting it in the Template: namespace. This can be negated by developing the template first.

 

But I do agree, it would be nice to have a completely separate dev wiki.

Link to comment
Share on other sites

  • 0

I remember awhile back you said string were superseded by text.

I started to change things over and found some weirdness with the form.

 

Instead of individual lines, there was a block on two specific properties, OblivionAuthor and OblivionVersion(I think it was this one). I haven't played with the field yet because school is kind of taking up most of the day and I am just too tired after I get out. :/

 

EDIT: I changed the title because it no longer is about the template itself but rather SMW help.

 

EDIT2: Its fun unintentionally breaking the wiki :/

 

EDIT3: I have no idea how to go about creating a template for mod query. Ill look around the wiki and the media wiki documentation later

 

Edit4: found some documentation here

https://semantic-mediawiki.org/wiki/Help:Template_format

Link to comment
Share on other sites

  • 0

They have nothing to do with each other (Templates versus SMW Forms and Properties). It doesn't matter if templates reside in the Template: namespace or on some other page, it in no way breaks association.

 

PRO

Placing templates in the Dev: namespace during development would not be searchable by default. The Template: namespace is searchable by default, Form: Property: and Dev: are not.

 

CON

Forms would need to be updated when a template is made live by putting it in the Template: namespace. This can be negated by developing the template first.

 

But I do agree, it would be nice to have a completely separate dev wiki.

Forgot we could set that.

 

Best answer is separate dev wiki. Having to rebuild the SMW data frequently is a bad thing on the prod site, and that along with your con above is all the reason we need.

Link to comment
Share on other sites

  • 0

Dev: is not a valid namespace because I followed your recommendation for the template and it resulted in

{{Template:Dev:TES4Templates/ModQuery|1=Roads of Cyrodiil|2=http://www.nexusmods.com/oblivion/mods/20218/|3=Arthmoor - Ukrr - mariedanj|4=orange|#=0}} 

Template used

Mod query

Hmm, for some reason that namespace was commented out. Re-enabled, working on getting the pages to populate correctly now.

 

EDIT: It's fixed now. Updated Dev:TES4Mod to use the template at DEV:TES4Templates/ModQuery.

Link to comment
Share on other sites

  • 0

I broke SMW again :/

rX9IIbHs0X0i

Category

ask page

 

 


 

I asked DoubleYou this same question.

I have:

{{#ask: [[Category:TES4Mod]]
| ?OblivionModUrl 
| ?OblivionModTitle
| ?OblivionAuthor
| ?OblivionColor
| format=template
| mainlabel=-
| template=Dev:TES4Templates/ModQuery
}}

in the template I want the the url to display the Mod title.

I tried using the #show, {{{2|{{{1}}}}}}, and various other things and I am stumped.

I asked DoubleYou and he couldn't figure it out so I am at a loss wit that issue

Link to comment
Share on other sites

  • 0

Several things to comment on.

 

  1. The additional entries appear to be residual links within the Wiki that are still referencing TES4Mod/Roads of Cyrodiil. The link points to the Dev: namespace, however it shouldn't be resolving. I tried cleaning up links with a MW maintenance script, but at one point it bombs. It's going to be in a funky state until I can resolve.
  2. Use named args for Semantic queries using a template format. Dealing with number place holders is horrible, because it's hard to maintain. Need things to be descriptive when dealing with so many arguments into a template. I updated your query page and template to show you how to do that. (use "named args=yes" and you can add =<name> to query arguments to rename them).
  3. Replacing the link with a title is not going to happen. It's already parsed by MW. You'll have to display the whole link from the query. Formatting the URL only works at moment of setting the variable because it has not been translated into a URL yet (it's still a string), which means it only works on the page it is defined on.
Link to comment
Share on other sites

  • 0

 

Several things to comment on.

 

  1. The additional entries appear to be residual links within the Wiki that are still referencing TES4Mod/Roads of Cyrodiil. The link points to the Dev: namespace, however it shouldn't be resolving. I tried cleaning up links with a MW maintenance script, but at one point it bombs. It's going to be in a funky state until I can resolve.
  2. Use named args for Semantic queries using a template format. Dealing with number place holders is horrible, because it's hard to maintain. Need things to be descriptive when dealing with so many arguments into a template. I updated your query page and template to show you how to do that. (use "named args=yes" and you can add =<name> to query arguments to rename them).
  3. Replacing the link with a title is not going to happen. It's already parsed by MW. You'll have to display the whole link from the query. Formatting the URL only works at moment of setting the variable because it has not been translated into a URL yet (it's still a string), which means it only works on the page it is defined on.

 

1. I don't try to break it, sometimes it just happens. Sorry about that.

EDIT: found this, take a look

 

2. Yeah, I was starting think the same. I just was focusing on using the link using the titles name.

 

3. hmm, so you're saying it is a limitation on the property because it can only be parsed when the data is on the same page.

Link to comment
Share on other sites

  • 0

1. I don't try to break it, sometimes it just happens. Sorry about that.

EDIT: found this, take a look

 

2. Yeah, I was starting think the same. I just was focusing on using the link using the titles name.

 

3. hmm, so you're saying it is a limitation on the property because it can only be parsed when the data is on the same page.

  1. Yes, those are the extra links I was referring to which are bogus.
  2. Cool
  3. It's not a limitation, it's just how the Wiki works. A URL Property expects a link, and at the time of the value being retrieved it is parsed as it should be. You can't take a link that is already turned into HTML and use the wiki syntax to re-create it. The only option would be to turn that Property into a Text type so that it is treated as a pure string, which defeats the purpose.
Link to comment
Share on other sites

  • 0

If you are curious what I am doing now, I am trying to figure out how to do multiple templates on one page.

I see a few key parts.

In the Form:

{{{field|table|holds template}}}
{{{end template}}}
{{{for template|PackTableEntry|multiple|embed in field=PackTableFrame[table]}}}
{| class="formtable"
! 
! style="width: 300px;" | Mod Name
! Installation Instructions
|-
| {{{field|packName|hidden|default={{BASEPAGENAME}} }}} {{{field|tableName|hidden|default={{SUBPAGENAME}} }}}
| {{{field|modName|mandatory|input type=combobox|values from category=Mods|existing values only}}} 
| {{{field|customInstall|input type=textarea|editor=wikieditor|autogrow}}}
|}
{{{end template}}}

The Template:PackTableFrame seems like its just a simple table.

 

Is there anything that I should know or should I just jump into it and hope for the best?

I did read some stuff but it didn't like it had everything. *shrugs*

Link to comment
Share on other sites

  • 0

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

 

The second block of code is only for doing multi-instance templates, and is identified by the used of the "multiple" and "embed in field" arguments. Those are more complex and are not the same as simply including two template calls within the page.

 

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

 

 

{{{for template|MyTemplate1}}}
<stuff>
{{{end template}}}
 
{{{for template|MyTemplate2}}}
<stuff>
{{{end template}}}

 

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.

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.