Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To create a tree:</p> <ol> <li>Goto site administration panel;</li> <li>Click +Add near 'Site Trees';</li> <li>Enter alias for your sitetree, e.g. 'maintree'.<br> You'll address your tree by this alias in template tags;</li> <li>Push 'Add Site Tree Item';</li> <li><p>Create first item: </p> <blockquote> <p><strong>Parent:</strong> As it is root item that would have no parent.<br> <strong>Title:</strong> Let it be 'My site'.<br> <strong>URL:</strong> This URL is static, so put here '/'.</p> </blockquote></li> <li><p>Create second item (that one would handle 'categoryname' from your 'categoryname/entryname'): </p> <blockquote> <p><strong>Parent:</strong> Choose 'My site' item from step 5.<br> <strong>Title:</strong> Put here 'Category #{{ category.id }}'.<br> <strong>URL:</strong> Put named URL 'category-detailed category.name'.<br> In 'Additional settings': check '<strong>URL as Pattern</strong>' checkbox.</p> </blockquote></li> <li><p>Create third item (that one would handle 'entryname' from your 'categoryname/entryname'): </p> <blockquote> <p><strong>Parent:</strong> Choose 'Category #{{ category.id }}' item from step 6.<br> <strong>Title:</strong> Put here 'Entry #{{ entry.id }}'.<br> <strong>URL:</strong> Put named URL 'entry-detailed category.name entry.name'.<br> In 'Additional settings': check '<strong>URL as Pattern</strong>' checkbox.</p> </blockquote></li> <li>Put '{% load sitetree %}' into yor template to have access to sitetree tags.</li> <li>Put '{% sitetree_menu from "maintree" %}' into your template to render menu.</li> <li>Put '{% sitetree_breadcrumbs from "maintree" %}' into your template to render breadcrumbs.</li> </ol> <hr> <p>Steps 6 and 7 need some clarifications:</p> <ul> <li><p>In titles we use Django template variables, which would be resolved just like they do in your templates. </p> <blockquote> <p>E.g.: You made your view for 'categoryname' (let's call it 'detailed_category') to pass category object into template as 'category' variable. Suppose that category object has 'id' property. In your template you use '{{ category.id }}' to render id. And we do just the same for site tree item in step 6.</p> </blockquote></li> <li><p>In URLs we use Django's named URL patterns (<a href="http://docs.djangoproject.com/en/1.1/topics/http/urls/#naming-url-patterns" rel="noreferrer">documentation</a>). That is almost idential to usage of Django '<a href="http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#url" rel="noreferrer">url</a>' tag in templates. </p> <blockquote> <p>Your urls configuration for steps 6, 7 supposed to include: </p> <p>url(r'^(?P&lt;category_name&gt;\S+)/(?P&lt;entry_name&gt;\S+)/$', 'detailed_entry', name='<strong>entry-detailed</strong>'),<br> url(r'^(?P&lt;category_name&gt;\S+)/$', 'detailed_category', name='<strong>category-detailed</strong>'), </p> <p>So, putting 'entry-detailed category.name entry.name' in step 7 into URL field we tell sitetree to associate that sitetree item with URL named 'entry-detailed', passing to it category_name and entry_name parameters.</p> </blockquote></li> </ul> <p>I hope this description should fill the documentation gap %)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload