Always snap to grid

Difference between revisions of "Template:Classname/doc"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
Line 1: Line 1:
 
<noinclude>{{Documentation subpage}}</noinclude>
 
<noinclude>{{Documentation subpage}}</noinclude>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
+
This utility template extracts the actual class name from a class page name. Game-specific class pages may have a game name appended in parentheses and due to technical restrictions [http://meta.wikimedia.org/wiki/Help:Page_name canonical page names] always have spaces instead of underscores. The alternate URL-encoded form always has underscores instead of spaces, but also escapes many other characters.
 +
 
 +
Class and interface description pages containing [[Template:Infobox class]] and [[Template:Infobox interface]] respectively make the page titles look as if the page name contains underscores only in the correct places through the use of this template and the "magic word" [http://meta.wikimedia.org/wiki/Help:Magic_words#Miscellany <nowiki>{{DISPLAYTITLE}}</nowiki>].
 +
 
 
==Usage==
 
==Usage==
This utility template extracts the game name from a class page name. Game-specific class pages may have a game name appended in parentheses and due to technical restrictions have spaces instead of underscores.
+
This template can take one parameter, which defaults to the current subpage name if omitted.
  
For example "UE2:ACTION GotoMenu (UT2003)" is the canonical name of the page about the UT2003 version of the ACTION_GotoMenu class. This template would strip the game name and namespace prefix and replace the space with an underscore to return "ACTION_GotoMenu".
+
Suppose the following code is on the page with the canonical name "UE2:ACTION GotoAction (UT2003)":
 +
<pre>
 +
{{classname}}
 +
</pre>
 +
It would return: {{classname|ACTION GotoAction (UT2003)}}
  
'''Note:''' This template assumes that it is used on the actual page named after the class. If the page name contains a game name or other information, those should be enclosed in parentheses and separated from the class name by a space, for example "Actor (UT)" or "Vehicle (UT2004)".
+
Note that the same code would return "Foo" if used on the subpage "ACTION GotoAction (UT2003)/Foo".
  
 
==See also==
 
==See also==
Line 12: Line 19:
 
* [[Template:Gamename]]
 
* [[Template:Gamename]]
  
<includeonly><!--
+
<includeonly>
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. -->
+
[[Category:Utility templates]]
[[Category:Utility templates|{{PAGENAME}}]]
+
 
</includeonly>
 
</includeonly>

Revision as of 16:03, 7 March 2008

This subpage contains documentation, categories and other content that is not part of the template.
To view the template page itself, see Template:Classname.

This utility template extracts the actual class name from a class page name. Game-specific class pages may have a game name appended in parentheses and due to technical restrictions canonical page names always have spaces instead of underscores. The alternate URL-encoded form always has underscores instead of spaces, but also escapes many other characters.

Class and interface description pages containing Template:Infobox class and Template:Infobox interface respectively make the page titles look as if the page name contains underscores only in the correct places through the use of this template and the "magic word" {{DISPLAYTITLE}}.

Usage

This template can take one parameter, which defaults to the current subpage name if omitted.

Suppose the following code is on the page with the canonical name "UE2:ACTION GotoAction (UT2003)":

{{classname}}

It would return: ACTION_GotoAction

Note that the same code would return "Foo" if used on the subpage "ACTION GotoAction (UT2003)/Foo".

See also