Redaktion (talk | contribs)
No edit summary
Redaktion (talk | contribs)
No edit summary
 
Line 19: Line 19:
==Including the template on a page==
==Including the template on a page==


#To include the template on a customer page, you simply add it from the Visual Editor ''Insert'' menu.  <br />[[File:Manual:Ve insert.png|alt=Insert menu of the visual editor|center|thumb|200x200px|Insert the template on a page]]
#To include the template on a customer page, you simply add it from the Visual Editor ''Insert'' > ''Template'' menu.  <br />[[File:Manual:Ve insert.png|alt=Insert menu of the visual editor|center|thumb|200x200px|Insert the template on a page]]
#Start typing the name ''Customer data'' and select the template (1). Then, click ''Add template'' (2). <br />[[File:Manual:Vorlage-einfügen-VE2-EN.png|alt=Select template|center|thumb|350x350px|Select template]]
#Start typing the name ''Customer data'' and select the template (1). Then, click ''Add template'' (2). <br />[[File:Manual:Vorlage-einfügen-VE2-EN.png|alt=Select template|center|thumb|350x350px|Select template]]
#Click ''Insert.'' Simply ignore the notice aobut missing template data, since we will create a form for the template in the next step. [[File:Manual:Manual smw templatedata notice.png|alt=Customer data template dialog box |center|thumb|500x500px|Notice about missing TemplateData]]<br />
#Click ''Insert.'' Simply ignore the notice aobut missing template data, since we will create a form for the template in the next step. [[File:Manual:Manual smw templatedata notice.png|alt=Customer data template dialog box |center|thumb|500x500px|Notice about missing TemplateData]]<br />
Line 31: Line 31:
​<span class="nextstep">[[Manual:Semantic MediaWiki/Examples/Customer data/Form|Create a form]]</span>
​<span class="nextstep">[[Manual:Semantic MediaWiki/Examples/Customer data/Form|Create a form]]</span>


{{Box Links-en|Topic1=https://www.semantic-mediawiki.org/wiki/Help:Semantic_templates Help page for semantic templates}}
{{Box Links-en|Topic1=https://www.semantic-mediawiki.org/wiki/Help:Semantic_templates Help page for data  templates}}


[[de:Handbuch:Semantic_MediaWiki/Beispiele/Kundendaten/Vorlage]]
[[de:Handbuch:Semantic_MediaWiki/Beispiele/Kundendaten/Vorlage]]
[[en:{{FULLPAGENAME}}]]
[[en:{{FULLPAGENAME}}]]

Latest revision as of 14:57, 15 July 2025

Creating the display template

To create the template, we go to the page Special:Create template. On this page, we have access to the properties that we have already created.

  1. Like in the previous step (creating properties), find the link "Create a template" from the search field of the Special pages overview page or scroll down to the Page Forms section.
    Create a template
    Create a template
  2. Define the data fields that you want to use in your template. For each property that you created, you need to have a placeholder-field (=template parameter) .
    Create the template
    Create the template

    • Template name (1): Enter Customer data as name for the template.
    • Category (2): Define a category which will be assigned to all customer pages that use this template. It makes sense to also call this category Customer data.
    • Field name (3): Create a field name for the property Has location. This field name is used in the template ith the data entry form. The name should not contain spaces.
    • Display label (4): This is the field label tha tis shown on the customer pages. It can contain spaces.
    • Semantic property (5): Choose the property Has location that you created in the previous step.
    • Add field (6): Click Add field to create the fields for the properties Has First contact and Has contact person.
  3. Click Save page at the end of the page.


The template is now available and can be viewed in the Template namespace. You do not have to edit the template any further at this point.

Including the template on a page

  1. To include the template on a customer page, you simply add it from the Visual Editor Insert > Template menu.
    Insert menu of the visual editor
    Insert the template on a page
  2. Start typing the name Customer data and select the template (1). Then, click Add template (2).
    Select template
    Select template
  3. Click Insert. Simply ignore the notice aobut missing template data, since we will create a form for the template in the next step.
    Customer data template dialog box
    Notice about missing TemplateData

  4. Save the page. The template is now included on the page.
    Included template
    Included template

Next step

Next, we create a form that makes it easy for users to enter the data.

Create a form

Related info



PDF exclude - start

To submit feedback about this documentation, visit our community forum.

PDF exclude - end