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

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).

Link to comment
Share on other sites

  • 0

 

 

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

Link to comment
Share on other sites

  • 0

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.
Link to comment
Share on other sites

  • 0

 

 

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.

Link to comment
Share on other sites

  • 0

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:"

Link to comment
Share on other sites

  • 0

 

 

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:"?

Link to comment
Share on other sites

  • 0

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:

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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

 

By looking at the example s4n provided, that appears to be true.

 

 

Is same true for Forms and properties?

I believe s4n said that it will only work for templates but he only mentions "form:" specifically. The quote below is directly from post #37.

 

 

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:"

 

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.