Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update documentation again
  • Loading branch information
Zenobius Jiricek committed Jun 3, 2012
1 parent 8d7994f commit 25f3fd4
Showing 1 changed file with 52 additions and 16 deletions.
68 changes: 52 additions & 16 deletions README.md
Expand Up @@ -13,10 +13,7 @@ administration interface.
## Installation ## Installation


1. make sure you are using a python virtual environment 1. make sure you are using a python virtual environment

`mkdir -p ~/Dev/virtualenv && virtualenv ~/Dev/virtualenv/projectname && . ~/Dev/virtualenv/projectname/bin/activate && mkdir -p ~/Dev/projects/projectname/ && cd ~/Dev/projects/projectname; `
virtualenv ~/Dev/virtualenv/projectname;
. ~/Dev/virtualenv/projectname/bin/activate;
cd ~/Dev/projects/projectname/;


2. install it from pypi 2. install it from pypi


Expand Down Expand Up @@ -48,23 +45,61 @@ the template selector combo dropdown in the admin interface.


For example, if your django project was at : For example, if your django project was at :


`~/Dev/Django/MyProjectName/` ~/Dev/Django/MyProjectName/


And you had a django application named `SomethingSomethingSomething` at : And you had a django application named `SomethingSomethingSomething` at :


`~/Dev/Django/MyProjectName/SomethingSomethingSomething/` ~/Dev/Django/MyProjectName/SomethingSomethingSomething/


Then templates for this plugin could be found at : Then templates for this plugin could be found at :


`~/Dev/Django/MyProjectName/SomethingSomethingSomething/templates/cmsplugin_embeddedmenu/layouts/*.html` ~/Dev/Django/MyProjectName/SomethingSomethingSomething/templates/cmsplugin_embeddedmenu/layouts/*.html


In fact, anywhere django looks for templates, you can place the following tree : In fact, anywhere django looks for templates, you can place the following tree :


```
/cmsplugin_embeddedmenu /cmsplugin_embeddedmenu
/layouts /layouts
/*.html /*.html
```
### Purpose of Templates

#### Containers

These are the top most elements in any menuplugin that exists in a placeholder.

By default it contains a H3 element and DIV element with the following attribtues :

*H3*

* Text: `MenuTitle`, input from plugin settings
* Text: `MenuSubtitle`, input from plugin settings

*DIV*

* `id='cms-menu-{{ plugin.id }}'`, where plugin.id matches the instance of the settings model for that menu.
* `class='cms-plugin cms-menuplugin'`
* `data-plugin-position={{ plugin.position}}`, sorted position within the placeholder.

#### Menus

These wrap each branch in a menu, they pull in each menu item node with the template selected from the
next template group `cmsplugin_embeddedmenu/layouts/items/*.html`

By default, menu branchs are displayed as un-orderded lists (UL) with no attributes.

#### Items

Renders each menu item node as a list-item(LI) with the following attributes:

*LI*

* `class='selected ancestor sibling descendant'`
* `selected` applies if the node matches the page being viewed
* `ancestor` applies if it contains a menu branch.
* `data-node-depth={{item.level}}`, how deep in the tree this node is.

If this node is a parent to other pages, then it will include the chosen `Menus` template inside the `LI` after the `A`



### Customising Templates ### Customising Templates


Expand All @@ -73,9 +108,11 @@ Templates in all groups are provided the context :
a CMSPlugin has many useful attributes for you to use, the main one a CMSPlugin has many useful attributes for you to use, the main one
is `plugin.instance` a reference to the settings model. is `plugin.instance` a reference to the settings model.


> plugin' :
> An instance of CMSPlugin, which itself provides reference to either plugin :
> of the settings models as outlined below. An instance of CMSPlugin, which itself provides reference
to either of the settings models as outlined below.



#### base.html #### base.html


Expand All @@ -87,11 +124,10 @@ selected template chosen in the administration interface.


templates here are provided the context : templates here are provided the context :


> plugin.instance
> template
> Chosen template.
>


plugin.instance
template
Chosen template.




## Contributions ## Contributions
Expand Down

0 comments on commit 25f3fd4

Please sign in to comment.