Jump to content


Photo

SMW questions and help


  • Please log in to reply
175 replies to this topic

#31 stoppingby4now

stoppingby4now

    Sleepy

  • Founder
  • PipPipPipPipPipPip
  • 2,419 posts

Posted 06 January 2015 - 08:42 AM

One thing to note, TES4 is not a namespace, so you are really creating a page titled TES4:Mod with a bunch of subpages under it. That's not ideal. But given our lack of a proper environment and that you are putting forth the effort to learn SMW, I won't complain too much. However, your great efforts are going to make me think about how to handle cases like this sooner than I realize, and that is supporting other games with a viable and supportable structure.

 

Setting properties belongs in the template, not the form.  It's the forms job to get input from the user, and then pass it to a template to handle the data. I took a look at your template, and there isn't any code that is assigning values to those properties, which is why nothing is being returned in the query.

 

You're second example is also missing a colon. Setting SMW properties is always:

 

[[PROPERTY::VALUE]]


  • 0

#32 hishutup

hishutup

    Daedric Prince

  • VIP-Supporter
  • PipPipPipPipPipPip
  • 2,680 posts

Posted 06 January 2015 - 11:08 AM

ok I tried using 

[[[OblivionModUrl::{{{Link}}}]] [[OblivionModTitle::{{{Title}}}]]]

and it does something of this sort

 

https://www.nexusmod...on/mods/20218/? Roads of Cyrodiil]

 

I dont understand why this isn't working. Is it because that is mediawiki markup?

Should I switch to html markup?


  • 0

#33 z929669

z929669

    Ixian Inventor

  • Administrator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7,082 posts

Posted 06 January 2015 - 11:34 AM

First off ...

 

@s4n

we have a Dev namespace, so why are we not using that?

 

Secondly ...

 

@hushutup

You are trying to implement something fairly complex using several properties and functions (e.g., debugging your #switch function is only one small piece ... there seems to be a redundant pipe at the end). As I stated previously, it is much, much, much simpler to begin with something very, very simple and build upon that.

 

First, clearly define your ultimate goal and what you want the SMW structure to accomplish. This will help us to determine first if what you want to do is even feasible, and it will allow us to help more if we see where you are trying to go.

 

Consistent with what you envision, pick one property that you want to actually use. Then create a stupid-simple template that uses that property (nothing fancy, just a very simple template). Then create a stupid-simple form to feed that template. Then you verify that it works and debug as necessary (which will be pretty easy and instructive). This sets up the base structure you will be working with ... Property page, Template page, Form page. Then begin adding in components one at a time, debugging each in turn before adding another layer of complexity. (components = any changes made by adding in elements like parserfunctions, new properties/fields, styles, etc.)

 

The way you seem to be going about it is by scavenging examples that you think apply to what you are trying to accomplish (which is not all that clear yet and why I mentioned that it would be helpful if you corrected your template to conform to standards ... which in turn may not be applicable, since it is a SMW template). Nevertheless, I think you are trying to jump into calculus before learning anything about algebra and trigonometry.

 

Start small and build up, debugging along the way. You will learn loads of things this way, and the help you will require will be more easily framed and addressed ... and you will require less help I think. The process takes time though, but if you are willing, we need more SMW developers.

 

EDIT:

RE you last post: You are getting back exactly what you asked for ... a link and a title (with an extra square bracket, bc you have one too many on the outside).



#34 hishutup

hishutup

    Daedric Prince

  • VIP-Supporter
  • PipPipPipPipPipPip
  • 2,680 posts

Posted 06 January 2015 - 12:36 PM

 

 

You are trying to implement something fairly complex using several properties and functions (e.g., debugging your #switch function is only one small piece ... there seems to be a redundant pipe at the end). As I stated previously, it is much, much, much simpler to begin with something very, very simple and build upon that.

The form works, I am moving onto calling certain properties.

The extra pipe in the switch is intentional because its the default if the field is empty.

 

 

 

First, clearly define your ultimate goal and what you want the SMW structure to accomplish. This will help us to determine first if what you want to do is even feasible, and it will allow us to help more if we see where you are trying to go.

I am just poking around. I kind of know what I want to do which is replicate the current mod page system but that is just a goal that I am trying to get to.

 

 

 

Consistent with what you envision, pick one property that you want to actually use. Then create a stupid-simple template that uses that property (nothing fancy, just a very simple template). Then create a stupid-simple form to feed that template. Then you verify that it works and debug as necessary (which will be pretty easy and instructive). This sets up the base structure you will be working with ... Property page, Template page, Form page. Then begin adding in components one at a time, debugging each in turn before adding another layer of complexity. (components = any changes made by adding in elements like parserfunctions, new properties/fields, styles, etc.)

I started with a simplified version of what I was originally intending. I started with something that had some content and verified that it worked. I am now expanding to being able to query the data and troubleshoot the issues.

 

 

 

The way you seem to be going about it is by scavenging examples that you think apply to what you are trying to accomplish (which is not all that clear yet and why I mentioned that it would be helpful if you corrected your template to conform to standards

I'll do the standards when I get home.

 

 

 

Start small and build up, debugging along the way. You will learn loads of things this way, and the help you will require will be more easily framed and addressed ... and you will require less help I think. The process takes time though, but if you are willing, we need more SMW developers.

Its not super complicated but there are somethings that can cause issues and that is where I am getting stuck.

 

I don't know where I am going with it because I am just poking around and seeing what can be done and maybe I be of use in the -near- future.

 

 

 

RE you last post: You are getting back exactly what you asked for ... a link and a title (with an extra square bracket, bc you have one too many on the outside).

That isn't exactly what I meant. It should look exactly like this

 

Roads of Cyrodiil


  • 0

#35 stoppingby4now

stoppingby4now

    Sleepy

  • Founder
  • PipPipPipPipPipPip
  • 2,419 posts

Posted 06 January 2015 - 02:54 PM

I updated the Template to fix it. Several things to make note of:

 

  1. Z makes a good point. During development, you should use pages within the Dev: namespace. That doesn't apply to Forms and Templates, but any pages that are created are much easier to hide away. Doing active development in the main STEP namespace is not good because the page can be returned from searches.
  2. Some HTML elements are illegal to use in Wiki's, and the <a/> element is one of them. It will be parsed and displayed as regular text.
  3. Semantic Properties of type URL do not need to have wiki markup to build the link. SMW does that automatically, which means the use of external links markup is useless and thus ignored. In this case you need to use the form of the setting a property such that when it is set, it uses alt text.
    [[MyProperty::some_value|alt title]]
    In this case, however, using the setting of the OblivionModTitle does not work because it's the wrong parse phase, and messes up the link. In order to work, it must be set prior to the display of the link and the {{#show}} inline query used to retrieve the value for the alternate text.

  • 0

#36 hishutup

hishutup

    Daedric Prince

  • VIP-Supporter
  • PipPipPipPipPipPip
  • 2,680 posts

Posted 06 January 2015 - 04:00 PM

 

 

Z makes a good point. During development, you should use pages within the Dev: namespace. That doesn't apply to Forms and Templates, but any pages that are created are much easier to hide away. Doing active development in the main STEP namespace is not good because the page can be returned from searches.

I didn't know this. I was told to try different things but I guess I will start to redirect the pages that that are created to that namespace.

What is the url to the dev namespace?

 

How do you go about creating namespaces? I am just curious.

 

 

 

Some HTML elements are illegal to use in Wiki's, and the <a/> element is one of them. It will be parsed and displayed as regular text.

I realized this. I don't know what is illegal and what isn't. Its probably listed somewhere.

The reason why I tried the <a> tag is because some MW markup is illegal, I found that so far most HTML works just fine, like the <ul> and <li>.

I couldn't experiment or change it back to it original form because I was in class and only had the time to make that change to see if it would work and as you said, it wont work.

 

 

Is there any reason to use 'string' over 'text'? 

I think I read something on searching becomes an issue when the value is over so many characters.

 

 

The third part, I am going to look into that a little more because it seems that I missed some important points.


  • 0

#37 stoppingby4now

stoppingby4now

    Sleepy

  • Founder
  • PipPipPipPipPipPip
  • 2,419 posts

Posted 06 January 2015 - 04:20 PM

As to the Dev namespace, I had forgotten that we created that. It's not your fault. And no one can create namespaces in the Wiki, they must be defined in the configuration on the server.

 

String should no longer be used as it is depricated. In the current version we are running, it is an alias to Text, but when we upgrade SMW, we'll need to convert any Properties that are defined as String to Text.

 

EDIT: Also to add a bit more information, templates can be used from other namespaces by transcluding the page with the namespace. If no namespace exists, then MW automatically tries to load the page name from the Template namespace.

 

Examples:

  • {{MyTemplate}} - transcludes [[Template:MyTemplate]]
  • {{Games:MyTemplate}}
    • If "Games:" namespace exists - translcudes [[Games:MyTemplates]]
    • If "Games:" namespace doesn't exist - transcludes [[Template:Games:MyTemplates]]

Form's on the other hand always start with "Form:"


  • 0

#38 hishutup

hishutup

    Daedric Prince

  • VIP-Supporter
  • PipPipPipPipPipPip
  • 2,680 posts

Posted 06 January 2015 - 04:56 PM

 

 

Semantic Properties of type URL do not need to have wiki markup to build the link. SMW does that automatically, which means the use of external links markup is useless and thus ignored. In this case you need to use the form of the setting a property such that when it is set, it uses alt text.

ok, I will have to break down what you did so I can observe how it all works.

 

I was fooling around with the #ask again and there is only two things that is getting me caught up but I'll see if I can figure it out later. If you really want to know its getting the Mod column to link the appropriate page and in the External Link column, I want it to show Link instead of the massive URL.

 

 

As to the Dev namespace, I had forgotten that we created that. It's not your fault. And no one can create namespaces in the Wiki, they must be defined in the configuration on the server.

 

String should no longer be used as it is depricated. In the current version we are running, it is an alias to Text, but when we upgrade SMW, we'll need to convert any Properties that are defined as String to Text.

 

EDIT: Also to add a bit more information, templates can be used from other namespaces by transcluding the page with the namespace. If no namespace exists, then MW automatically tries to load the page name from the Template namespace.

 

Examples:

  • {{MyTemplate}} - transcludes [[Template:MyTemplate]]
  • {{Games:MyTemplate}}
    • If "Games:" namespace exists - translcudes [[Games:MyTemplates]]
    • If "Games:" namespace doesn't exist - transcludes [[Template:Games:MyTemplates]]

Form's on the other hand always start with "Form:"

That is all good info and I'll change a few things.

 

 

Is the actual dev namespace called "Dev:" or "Development:"?


  • 0

#39 stoppingby4now

stoppingby4now

    Sleepy

  • Founder
  • PipPipPipPipPipPip
  • 2,419 posts

Posted 06 January 2015 - 07:17 PM

Queries only return the data that is stored in the properties. If you want to do any kind of formatting, you will have to use a template format. All of the data that is returned is then passed to the Template and you can format it any way you want.

 

That is defined by adding the following two parameters to the ask query:

 

|format=template

|template=<template name>

 

The dev namespace is Dev:


  • 0

#40 z929669

z929669

    Ixian Inventor

  • Administrator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7,082 posts

Posted 06 January 2015 - 07:59 PM

To use Dev: , simply move all of your dev pages from, say, "MyPage" to, "Dev:MyPage". Forms/Templates/Properties will need to stay in their own namespace, but all of the content created using them can land in Dev:. namespace



#41 stoppingby4now

stoppingby4now

    Sleepy

  • Founder
  • PipPipPipPipPipPip
  • 2,419 posts

Posted 06 January 2015 - 08:25 PM

Templates are moveable. Any page can be a template.
  • 0

#42 hishutup

hishutup

    Daedric Prince

  • VIP-Supporter
  • PipPipPipPipPipPip
  • 2,680 posts

Posted 06 January 2015 - 11:46 PM

Ok, I redirected the page creation to Dev:TES4Mod/<mod>

I may move the templates, I haven't decided.

I erased the info off the pages that I am no longer using.

I can list out the page that I am no longer using if you want.

 

On this page there are two mods listed but there is only one when looking at the Category.

I was browsing through the properties and I saw something interesting...

60. Http://www.nexusmods.com/oblivion/mods/20218/?|[[OblivionModTitle (0)  

I tried commenting out the info on most of my pages and I couldn't find what is causing this. 

I am thinking its from a rouge page somewhere that is half broken.

 

After I figure out what those issues are then I guess I'll go an make the form for the #ask on Dev:TES4Mod


  • 0

#43 stoppingby4now

stoppingby4now

    Sleepy

  • Founder
  • PipPipPipPipPipPip
  • 2,419 posts

Posted 07 January 2015 - 12:33 AM

Did some cleanup, it's all good now.


  • 0

#44 hishutup

hishutup

    Daedric Prince

  • VIP-Supporter
  • PipPipPipPipPipPip
  • 2,680 posts

Posted 07 January 2015 - 12:44 AM

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?


  • 0

#45 z929669

z929669

    Ixian Inventor

  • Administrator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7,082 posts

Posted 07 January 2015 - 03:00 PM

Templates are moveable. Any page can be a template.

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

 

Is same true for Forms and properties?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users