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

hmm, I was looking around some more and disabling the caching doesn't seem to be required but rather that the hook would completely defeat the purpose of caching, which is understandable. 

I doubt that s4n is going to add it because of that reason.

 

I don't know exactly how parsing is done but if its done once then assigned to a variable then it doesn't seem like a major impact.

Link to comment
Share on other sites

  • 0

Extension:MyVariables will never be installed on this Wiki.

 

Parsing is done after a save of a wiki page, and all wiki syntax, parser functions, and template calls are converted to html and cached for quicker load times.

 

Any extension that allows parser functions for displaying dynamic data must disable the cache entirely. Grabbing the username is dynamic as it must be queried on every page view. That means the entire page must be parsed on every page view. Obviously, that negates the entire benefit of the cache, and the problem compounds itself should such usage be allowed in templates. Not gonna happen.

 

The extension page does a disservice by not disclosing that the cache is disabled when those parser functions are used.

Link to comment
Share on other sites

  • 0

This is interesting...

On the form here

I have a multiple instance template that should have 4 parts to it which are the Mod name, Description, Notes, Custom Install.

For some reason when I go to create with form and click "add another", I only get the Mod name and the Description but the other two (Notes and Custom Install) are no where to be seen. 

I was looking at a few other wikis and theirs seems to work just fine.

 

Im assuming I am missing something simple.

 

EDIT: Another thing I noticed is that you can't put a table within a table on a multiple instance template which I thought was possible.

 

 

EDIT2: last thing, way back on post 14 z said,

 


You are not ready for deletion rights until you have a good understanding of how our current relationships work ... only s4n and I and Farlo can do that.

What do you mean by "current relationships" 

Link to comment
Share on other sites

  • 0

First off, the method you are using with the custom button to create a new page is wrong. There is no way for the form to know where to create the page. You need to use the following which will automatically create a field for the user to enter the page name, and a button to create the appropriate page.

{{#forminput: form=Oblivion_Guide_Form}}

Second, you were missing a third ending curly brace (}) on the notes and install field declarations. The missing one on the notes field screwed up everything after. I updated and they are showing now.

 

Third, what do you mean by putting a table in a table in a multiple instance template? Why would you even want to place a table inside a table?

Link to comment
Share on other sites

  • 0

"Current relationships" meaning "understand the Data Dictionary" and the relationships among the SMW components implemented on our wiki.

 

Even I do not fully understand it all, but I do understand the relationships and what actions could break the structure.

 

Actually, only s4n and me have the ability to delete pages from the wiki, Step Staff may also be able to delete pages, but they can't delete protected pages (I don't think) ... i am not in a position to look at the configuration right now, and I forget the specifics.

Link to comment
Share on other sites

  • 0

First off, the method you are using with the custom button to create a new page is wrong. There is no way for the form to know where to create the page. You need to use the following which will automatically create a field for the user to enter the page name, and a button to create the appropriate page.

{{#forminput: form=Oblivion_Guide_Form}}

The page that would be created or edited was fixed to Dev:TES4Mod/Guide because I only wanted it to create one page for the time being because I cannot keep track of different pages nor can I delete them. I was happy with the way it was originally and I didn't see anything wrong with how it was set up, unless there was a specific reason that I am not aware of.

 

 

Second, you were missing a third ending curly brace (}) on the notes and install field declarations. The missing one on the notes field screwed up everything after. I updated and they are showing now.

Really... I knew it was something small.

 

Third, what do you mean by putting a table in a table in a multiple instance template? Why would you even want to place a table inside a table?

 

The purpose is like having a matrix of cells. Its just easier to use tables to keep everything aligned.

Link to comment
Share on other sites

  • 0

If you are going to support creating multiple guides, then the forminput is the only way to go. If you are only going to support the one guide page, then add the following to Dev:TES4Mod/Guide:

[[Has default form::Oblivion_Mod_Guide]]

Then you can go to Dev:TES4Mod/Guide and "Edit with Form". Don't place custom links/buttons on the form page.

 

Regarding the tables, what exactly were you trying to do that wasn't working? I questioned this because if you already have a table, what is the purpose of inserting another one when creating additional rows/columns will suffice? I see you created a table surrounding the fields in your template, were you trying to create yet another table inside of that?

 

You can also take a look at Form:Mod on how alignment was accomplished without the use of tables.

Link to comment
Share on other sites

  • 0

If you are going to support creating multiple guides, then the forminput is the only way to go. If you are only going to support the one guide page, then add the following to Dev:TES4Mod/Guide:

[[Has default form::Oblivion_Mod_Guide]]
 

Then you can go to Dev:TES4Mod/Guide and "Edit with Form". Don't place custom links/buttons on the form page.

 

Regarding the tables, what exactly were you trying to do that wasn't working? I questioned this because if you already have a table, what is the purpose of inserting another one when creating additional rows/columns will suffice? I see you created a table surrounding the fields in your template, were you trying to create yet another table inside of that?

 

You can also take a look Form:Mod on how alignment was accomplished without the use of tables.

 

Its hard for me to explain what I am trying to do because there are so many working bits but lets just say it should be pretty cool when it comes together :P

 

 

What is currently being done isnt the final product. There are several layers that I am missing but those are going to be easy to add once everything is pointing in the correct direction.

I am going to add support for other games (TES3, TES4, TES5, FO3, FNV) as well as other guides but first I need to get some stuff figured out, such as the best way to handle different forms of data. 

 

The "Guide" page is pretty much a quick and dirty way to try new things.

 

I'll end up handling the "has default form" like I did with the mods directory and by that I mean have a main template that contain the following line, if something is incorrect then ignore the mistake because I wrote it from memory.

EDIT: The line should come true if there is at least ONE mod on the page, otherwise it should be void by my understanding.

{{#if: {{#show: {{PAGENAME}}|?{{BASEPAGENAME}}_{{SUBPAGENAME}}}}|[[Has default form::Oblivion_Mod_Guide]]}}

The thing that I was trying to do is have "Mod Name" above the field and have those be on the left side while the other 3 boxes hang out on 75% of the right space.

 

I know I can use css but I am terrible at it. 

I don't do visual design, I mean look at my color choice, its pathetic.

Link to comment
Share on other sites

  • 0

Complicating things more than they need to be. :)

 

All you need to do is have a common category that the guides go in, and add [[Has default form::Oblivion_Mod_Guide]] to the category page. Then when a page is created using the form, the template would add the page to the category. Simpler, and doesn't incur the firing of multiple inline queries in regards to using multiple instance templates which will cause slow page saves as more and more mod's are included.

 

For the layout, you can specify Mod Name to be be in the first row and have it span all columns. Then it sounds like you want two columns, left and right for the remaining items which is easy enough. All with a single table. If you'd like positioning with a column layout using div's I can help with that too. It doesn't involve any css.

Link to comment
Share on other sites

  • 0

I need to add various things before I get into formatting because I'll end up changing my mind.

I'll try to get on adding cleaning stuff and hopefully get to the bash tags(I forgot about loot :/) portion.

 

That line should only fire once because it will exist on the main guide page.

I had to do similar line for mod dictionary because the mods can be embedded without comprising SWM data.

 

What I want to do is very complicated and should be very interesting if I can follow through.

Link to comment
Share on other sites

  • 0

I see what you are trying to do. However I would say it's not good use of a SMW property. Using them in that way can lead to a lot of clutter that we'd rather avoid. If a property isn't directly adding value to associative content on a page that can't be handled via standard MediaWiki means, it's a candidate for deletion.

 

Good work overall though in picking this up.

Link to comment
Share on other sites

  • 0

There is a reason for the property and if I start moving things around I will have to find a better way to do it but it is part of the Requirements and the Incompatible parts.

Those are things that work but took hours to figure out. Anyhow, here is the property that is being discussed. I did see a bogus one with the same name.

If anyone is going to clean up some pages then I have a few that can probably be disposed of.

 

Hmm, time for some stupid questions with probably several coming soon :/

Is it possible to have a multiple instance template in another multiple instance template?

Can SMW properties be parsed with a dependent value from a templates field?

Is it possible for a field/fortemplate to be hidden unless there is a true condition?

Can a multiple instance template field hold a template?

 

I believe the answer is no.

Link to comment
Share on other sites

  • 0

There is a reason for the property and if I start moving things around I will have to find a better way to do it but it is part of the Requirements and the Incompatible parts.

Those are things that work but took hours to figure out. Anyhow, here is the property that is being discussed. I did see a bogus one with the same name.

If anyone is going to clean up some pages then I have a few that can probably be disposed of.

The use of that property is not dependent on SMW. It can just as easily be solved by using a Category. SMW is about providing associations of information for pages. Categories work far better for the purpose of identifying like pages because they are searchable using standard MW, and SMW properties are not. Not everything needs to be a SMW property, and they should be used appropriately. Uses of properties that are deemed useless and a waste, I will remove at my discretion.

Hmm, time for some stupid questions with probably several coming soon :/

Is it possible to have a multiple instance template in another multiple instance template?

No

Can SMW properties be parsed with a dependent value from a templates field?

Not sure what you mean, could you elaborate more.

Is it possible for a field/fortemplate to be hidden unless there is a true condition?

No for a template, but you can for a field. Use a checkbox and then specify the field you want to show when it's checked, and it needs to be wrapped in a div. Example:

{{{field|enable|input type=checkbox|show on select=reveal}}}
<div id="reveal">{{{field|reveal}}}</div>
Can a multiple instance template field hold a template?

No

I believe the answer is no.

@s4n

What's the status of the wiki update and the dev wiki implementation?

I've had maintenance/deployments for work every night this week, so I haven't been able to finalize the update.

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.