Commit 2ebc17b4 by Xavier Antoviaque

Merge pull request #26 from FiloSottile/default_display_name

Document the Nav title text and set a default display name
parents 9c42ebb5 1c2b3447
......@@ -155,6 +155,21 @@ size. The value of those attribute should be valid CSS.
</mentoring>
```
### Custom Nav title
The Nav title (the black tooltip showed on hover on the Units Nav bar) is a list of the `display_name` attributes of all the blocks present in that Unit.
So two Mentoring blocks like the following will result in a tooltip like the one below:
```xml
<mentoring url_name="mentoring-0a06b184" weight="20" display_name="First Mentoring block">
<mentoring url_name="mentoring-1a04badd" weight="20" display_name="Second Mentoring block">
```
![image](https://cloud.githubusercontent.com/assets/1225294/2820216/b0228fd8-cef7-11e3-98e1-5fdbf49b706a.png)
The default title is "Mentoring Block".
Installing dependencies
-----------------------
......
......@@ -257,3 +257,14 @@ class MentoringBlock(XBlockWithLightChildren):
Scenarios displayed by the workbench. Load them from external (private) repository
"""
return get_scenarios_from_path('templates/xml')
@property
def display_name_with_default(self):
"""
Return a display name for the module: use display_name if defined in
metadata, otherwise use a custom default value.
"""
name = self.display_name
if name is None:
name = "Mentoring Block"
return name
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment