Jump to content
  • 0
hishutup

SMW questions and help

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.

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

You didn't answer my question. What are you trying to do precisely?

 

Yes, we all have a unique naming structure. It is very hard to follow another person's work.

Share this post


Link to post
Share on other sites
  • 0

Answering GrantSP's question ... I am attempting to extract OrderID and place into a list with mod name. You need to reference the Data Dictionary to understand what templates are in play for establishing the OrderID... this is getting closer I think.

Share this post


Link to post
Share on other sites
  • 0

This?

If you want the install to line up with mo then there would be several things that you would have to do differently.

 

That Example is full of errors

Share this post


Link to post
Share on other sites
  • 0

Nope, still not understanding. I don't think I am alone on this confusion.

Can you manually fill in the first 5 lines of the table because I have to be missing something.

you want to call OrderID? 

 

Sorry, I have no idea what you're asking.

Share this post


Link to post
Share on other sites
  • 0

Sorry, updated the link in my last ... had it wrong

 

... the question is posed to s4n, as he wrote the relevant code.

 

... you are alone in your confusion, because nobody else is responding to my question :)

Share this post


Link to post
Share on other sites
  • 0

I'd respond but I have no idea what is happening.  ::):

Everytime I looked at those links they were different, sometimes I see a list of mods other times I see templates that I don't know what to make of.

 

This link looks promising. If that PriorityID is added to ONLY the mods that need to be sorted, then that would do what I was thinking. I really hope I didn't send you all on a wild goose chase, it was only a curiosity I was wondering about.

Share this post


Link to post
Share on other sites
  • 0

No response expected from you or anyone else really ... besides s4n. He is the only one with the XP to address ;)

 

Not a wild goose chase at all. It was an excuse to exercise some rusting SMW 'skills' (or lack thereof)

Share this post


Link to post
Share on other sites
  • 0

It is important to note that the orderID is not actually required for sorting in terms of the STEP mod list. The list is already in order just by querying the page and relevant section.

 

I will take a look at the query in a bit Z.

Share this post


Link to post
Share on other sites
  • 0

Yep, I understand that, but am curious as to how to incorporate a subproperty property within a query along with properties from another template. The links in my post above are to what I have so far (with scant assistance from this page)

 

Actually, querying properties among disparate templates is also something of interest, but that should be simpler I would guess.

Share this post


Link to post
Share on other sites
  • 0

You don't query templates, you query pages. I updated your query to remove the template call as it's not needed for the example. The OrderID is added to the display, the list is sorted on the OrderID, and order is set to descending so last installed mod is now shown first. Primary exercise is to show how it can be used to sort, though the OrderID is useless for us as a sorting key.

 

Your template was attempting to query for OrderID which is incorrect. That data is available from the primary query, just had to add it to list of properties you wanted. It's use after the first query is only visual if you choose to display it.

Share this post


Link to post
Share on other sites
  • 0

I take that back, OrderID is required to sort the install order.

 

I have also updated Template:CoreModOrderedList to use named args, and display OrderID if it is provided.

 

This page does not display the OrderID:

https://wiki.step-project.com/User:Stoppingby4now/OrderTest1

 

This page displays the OrderID:

https://wiki.step-project.com/User:Stoppingby4now/OrderTest2

Share this post


Link to post
Share on other sites
  • 0

OK so it was much simpler than I was making it out to be ...

 

... is this because I was basing my query off of the query using the template call, which in turn was only required because we were bringing in SourceURL from the multiple-instance template?

 

In other words, the distinction between subobject property and normal property does not require anything special as does using a property that is part of a multiple-instance template ... the latter requires a template call within the query, because the query must iterate through the MI-template to fetch that property value for each ModName instance ... ?

Share this post


Link to post
Share on other sites
  • 0

That just totally confused me.

 

First off, there are no multiple instance templates. This isn't a form.

 

You were attempting to query in the secondary template for OrderID which you will never get because it isn't associated with a Mod page. It is associated with all of the subobjects on the ModList page for the version of STEP you are querying, but the query doesn't pass that in (mainlabel=-). It is available to you in the primary query of the subojects by requesting it:

|?OrderId

A template format for a query is only necessary for one of two things (or both):

  1. Formatting results in a custom manner that isn't provided by SMW
  2. Chaining queries for additional information on related pages, as you can't place a query inside a query

As for querying of subobjects versus properties, they are mostly the same. All properties are tied to a Wiki page (not templates), so you are requesting pages that match the query conditions, and then proceed to ask for Properties that exist on those resultant pages. Subobjects are slightly different as they reference the page in which they are used, so it's a reverse mapping. When asking for mods in a STEP version, the query condition is the subobject-property "Version", which returns the sub-object, which is mapped to the ModList page, and since each suboject has a unique ID (random ID which we care nothing about), you get all subobjects back instead of the actual page. No template is required for either scenario to get at the data. The only time you need a template is for the 2 reasons above.


Instead of having the if parser function couldn't you do this or no...
{{#ask:[[Concept:ModsInSTEP]] [[Property:IsCore]]

No, that won't work because the data isn't in the suboject which is what is being queried. The purpose of the subobjects for the STEP installation order is to record the Mod and it's order. Any additional information can then be queried from the Mod page itself using a template format. It is also always better to use {{#show}} when needing access to a single property in downstream queries.

Share this post


Link to post
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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.