Templates


Wie man Templates benutzt.

Was sind Templates?

These are pre - prepared pages, pro - formers, or forms that you may wish your wikidot contributers to use. An excellent example can be found at http://siliconcity.wikidot.com/template:herocharacter.

Schritt 1.

Erstellen eines Templates

But before we do, go and have a look in Site Manager » Page templates
Note that it will inform you that you don't have any!

template-false.jpg

So best we make one.

Using the new page button on the side menu bar, create a new page called (for example):-

template:typeone

the "template" is the category reserved for templates.
"typeone" is the name you wish to give it.

Then type some text in it how you would like. You can always edit it later, so for example lets put in:-

  • Ingredients
  • Cooking time
  • method
  • serves

Save it.

Just for the hell of it, let create another template called "typetwo"
Again, in the New Page box on the side bar create a page named
template:typetwo

Then enter some text, eg:-

  • Country of origin
  • Alloy type
  • Value

Now lets go back to Site Manager » Page templates

You will see two boxes.

template-true.jpg

The left one shows the Categories used in your site.
The right one lists the templates you have made.

If you click on the templates listed, you will see a preview underneath. (note i could only get it to preview one of them. I think there is a bug, but don't worry)

Now go back to your site
Create a new page in the New page box on the side bar.
Have a look in the edit box
you should see a new drop down box

Initial template: |~ no template (default)|

This should display the templates you have created. (note there is also a number of no template (default) listed. Again I think this is a bug.)

Click on the one you wish to use.

Job Done!!


Part two:

Assigning templates to Categories.

You might find it useful to use a particular template for a particular category.

Eg.

category Template
breads bread template
meats meat template
Cakes Cake template

First lets create the templates as we did above.

eg :-

  • template:bread template
  • template:meat template

Then we create the categories, using the New Page box. More info here. It will be a good idea to have a "base" "start"page, or "Introduction" page to each category.
eg:-

  • Breads:basebread
  • Meats:basemeat

Adding the create page box

Lets use "breads" as an example.

  • create template. Called. template:breads
  • create new page called breads:basebread

In the new breadbase page inset the following code

[[module NewPage category="breads"]]

Once you have saved that new page you should have a new "create page" box displayed

create-page.jpg

creating new pages within it, eg:-

  • newpage one
  • newpage two
  • newpage three

will do two things.

  1. create a new page and automatically put it in the "breads" category
  2. present the user with the template required for that category.

Step Three:

The Side Bar

Instead of having a base page with the Create new page module, we can place that module on the Side (nav:side) Bar.
In the default set up, using the New page module, will give you the opportunity to chose which Template you wish to use.

If we create a NEW Side bar, and assign that to say the Base Category, then we can use that to give the required template as the default option.

For example:
Have a look at at the side bar to your left. Right at the top it says "nav:side-en"
This is the actual page name of that particular side bar.
Now have a look : Here
Notice at the top, it says "nav:side-de." This is the German category side bar
Just to hammer it home, have a look here
This is the Spanish version of the side bar

Adding New page to it

In each of these Side bars we could add a Create Page module.
When we enter a page name in it, it will automatically assign that page to that particular category, and if we tell it to, we can make it apply a specific template.

eg: Inserting the following into the a side bar that has been assigned to the category "breads"

[[module NewPage category="breads" size="15" button="new page"]]

Will generate a new page, automatically put it in the "breads category, AND if a template has been assigned to that category, automatically provide you with that template.

EDIT: This does not work as explained.
Your explanation suggests that when one creates a "template:name-one" and a page "name-one:first" the template is automatically used without invoking it. This is not so. And the similar page names between the "template:X" and "X:demo-page" have no relations. Instead one needs to use

[[module NewPage category="ball" template="round-object"]]

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License