Setting Properties in Templates

From semantic-mediawiki.org

Is it possible to set properties in templates in any useful manner? I've done it, and they show up in the "factbox" at the bottom of the page, but they do not show up when I browse properties. I also cannot seem to access them via #ask queries.

22:57, 22 March 2013

Do you mean that you set properties of the templates not the pages that include them? If so, try setting $smwgNamespacesWithSemanticLinks [NS_TEMPLATE] = true;

09:16, 23 March 2013

Yes, I want to be able to set the synopsis and template group for each template, so it's easier to keep track of all the templates we use. The number of templates is getting a little out of hand so I think this will help. Will setting [NS_TEMPLATE] = true; affect the normal usage of setting properties using templates? Basically, as long as any properties intended to be transcluded are wrapped in INCLUDEONLY tags they're not going to be set to the template, right? See example below.


<noinclude>
[[Where set::On template only]]
</noinclude>

<includeonly>
[[Where set::On pages including template only]]
</includeonly>

[[Where set::On template and on pages including template]]

16:14, 23 March 2013

Yes, I suppose, as long as you wrap the properties meant for the page that include templates in <includeonly> they will be set for those pages only, the same way as categories. Your example seems to be correct. I think you should try it now.

16:28, 23 March 2013