20
21
22
23
31
32
33
34 {% show_menu 0 0 0 0 %}
35
36
37 {% block slider %}
38
39
40
41 {% placeholder "slider_images" or %}
42 {# show_placeholder "slider_images" request.current_page.get_home_pk_cache #}
43

44

25 {% show_placeholder "header" request.current_page.get_home_pk_cache %}
26
28 {% endplaceholder %}
29
30
31
32
33
34 {% show_menu 0 0 0 0 %}
35
36
37 {% block slider %}
38
39
40
41 {% placeholder "slider_images" or %}
42 {# show_placeholder "slider_images" request.current_page.get_home_pk_cache #}
43

44

45

46

47 {% endplaceholder %}
48
49
50
56
57
58
59 {% endblock %}
60
61
62
63
71
72
73 {% placeholder "content-top" or %}
74 {% endplaceholder %}
75
76
77 {% placeholder "content-left" or %}
78 {% endplaceholder %}
79
80
81 {% placeholder "content-right" or %}
82 {% endplaceholder %}
83
84
85
86 {% placeholder "content-bottom" or %}
87 {% endplaceholder %}
88
89
90
91
92
93
94
95
96
97
98
99
102
103 {% render_block "js" %}
104
105
==== template tags explained ====
* https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs
* http://docs.django-cms.org/en/2.1.3/advanced/templatetags.html
* https://docs.djangoproject.com/en/dev/topics/templates/#variables
== placeholder ==
Place holder is put where dynamic content is desireable. Django-cms will allow page editor to replace it with one of the plugins.
{% placeholder "name" or %}
anything withing this block...
{% show_placeholder "header" request.current_page.get_home_pk_cache %}
... will be displayed if no plugin is input or the plugin returns no output.
{% endplaceholder %}
== show_placeholder ==
Show a specific placeholder from a given page. This is useful when a content should be used in many pages.
Arguments:
* placeholder_name
* page_lookup (see Page Lookup for more information)
* language (optional)
* site (optional)
{% show_placeholder "header" request.current_page.get_home_pk_cache %}
== page lookup ==
The page_lookup argument, passed to several templatetags to retrieve a page, can be of any of the following types:
* String: interpreted as the reverse_id field of the desired page, which can be set in the “Advanced” section when editing a page.
* Integer: interpreted as the primary key (pk field) of the desired page
* dict: a dictionary containing keyword arguments to find the desired page (for instance: {'pk': 1})
* Page: you can also pass a page object directly, in which case there will be no database lookup.
If you know the exact page you are referring to, it is a good idea to use a reverse_id (a string used to uniquely name a page) rather than a hard-coded numeric ID in your template. For example, you might have a help page that you want to link to or display parts of on all pages. To do this, you would first open the help page in the admin interface and enter an ID (such as help) under the ‘Advanced’ tab of the form. Then you could use that reverse_id with the appropriate templatetags:
{% show_placeholder "right-column" "help" %}
Help page
If you are referring to a page relative to the current page, you’ll probably have to use a numeric page ID or a page object. For instance, if you want the content of the parent page display on the current page, you can use:
{% show_placeholder "content" request.current_page.parent_id %}
Or, suppose you have a placeholder called teaser on a page that, unless a content editor has filled it with content specific to the current page, should inherit the content of its root-level ancestor:
{% placeholder "teaser" or %}
{% show_placeholder "teaser" request.current_page.get_root %}
{% endplaceholder %}
== block ==
Block tags tell template engine that a child page, which extends this template, may overwrite these portions of the template.
{% block block_name %}