Commit f2d16bc6bc5da35ee92f2880d8aa9b635c9773d3
1 parent
8802d4d5
Exists in
master
and in
4 other branches
Update documentation
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
docs/source/dev.rst
| ... | ... | @@ -43,12 +43,13 @@ Example Widget: |
| 43 | 43 | class MyWidget(Widget): |
| 44 | 44 | identifier = 'my_widget_id' |
| 45 | 45 | name = 'My Widget' |
| 46 | - def generate_content(self, request): | |
| 46 | + def generate_content(self, **kwargs): | |
| 47 | 47 | # process HTML content |
| 48 | 48 | self.content = processed_content |
| 49 | 49 | |
| 50 | 50 | To add the widget in a view check the Widgets section in User Documentation. |
| 51 | 51 | To use a widget in the templates, you have to use the ``import_widget`` tag inside the ``html`` block. |
| 52 | +This way, the kwargs parameter will have a ``context`` key from the ``html``. | |
| 52 | 53 | You can also set the variable that the widgets of an area will be imported. |
| 53 | 54 | Or you can use the default name, which is ``widgets_area_name``. |
| 54 | 55 | For example, in the ``profile`` area the variable name is ``widgets_profile``. | ... | ... |