Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Implement a view which renders only the contents of your new tab
    • This view must subclass DjangoView and use the mixin DjangoFragmentViewMixin.
    • Implement the render_to_fragment method which should render the content.
    • See the Discussions tab example below to see how this works.
  2. Implement a full page view
    • You must render a mako template with the correct boilerplate to show the tabs correctly. An example would be as follows:

      Code Block
      languagexml
      ## mako
      <%! from django.utils.translation import ugettext as _ %>
      <%namespace name='static' file='/static_content.html'/>
      <%inherit file="/main.html" />
      <%block name="bodyclass">view-PAGE-SLUG is-in-course course</%block>
      <%block name="pagetitle">${_("PAGE NAME")}</%block>
      <%block name="headextra">
      <%static:css group='style-course'/>
      </%block>
      <%include file="/courseware/course_navigation.html" args="active_page='PAGE-SLUG'" />
       
      TEMPLATE CODE
    • Be sure to fill in PAGE-SLUG and PAGE NAME with the correct slug and name for your new page. Replace TEMPLATE_CODE with the Mako markup and code for the rest of the page.

    • See the Teams tab example below to see how this works.

Examples

Anchor

...

discussion-example

...

discussion-example
Fragment Example: Discussions tab

The Discussions feature renders its tab as a web fragment. Here's how it works:

...