Difference between revisions of "Best Practices for Forms and Templates"

From edegan.com
Jump to navigation Jump to search
Line 2: Line 2:
  
 
*https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types
 
*https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types
 +
 +
==Conventions==
 +
 +
*Use Sentence case property names
 +
*Use verb phrases (like "Has capital") - see https://www.semantic-mediawiki.org/wiki/Help:Property_naming
 +
 +
You can assign the type of a property and restrict a property's value by creating a page for that property.
 +
This is a property of type [[Has type::Text]].
 +
 +
The allowed values for this property are:
 +
* [[Allows value::Idea]]
 +
* [[Allows value::In development]]
 +
* [[Allows value::Draft]]
 +
 +
Also, the following create a link to a property page and show its information:
 +
<nowiki>
 +
[[Property:Has_paper_status]]
 +
{{Property:Has_paper_status}}
 +
</nowiki>
 +
  
 
==Notes==
 
==Notes==

Revision as of 19:37, 27 February 2017

Links

Conventions

You can assign the type of a property and restrict a property's value by creating a page for that property.

This is a property of type TextProperty "Has type" is a declarative property and can only be used on a property or category page..

The allowed values for this property are:
* IdeaProperty "Allows value" is a declarative property and can only be used on a property or category page.
* In developmentProperty "Allows value" is a declarative property and can only be used on a property or category page.
* DraftProperty "Allows value" is a declarative property and can only be used on a property or category page.

Also, the following create a link to a property page and show its information:

 [[Property:Has_paper_status]]
 {{Property:Has_paper_status}}
 


Notes

Check that you did the following:

  • Put the category in the template itself
  • Make sure that there is a default form associated with the template
 {{#default_form:McNair Projects}}
 [[category:McNair Projects]]
 

Use simple assignment whenever possible:

| label6       = Start Date
| data6        =  

If you have to use an array ref, here's the syntax:

| label5      = Owner
| data5       =