Skip to content

Commit 5c2b3a2

Browse files
authored
docs: configuring inlines to display in dynamic tabs (#1182)
1 parent 975b4a8 commit 5c2b3a2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/tabs/dynamic.md

+7
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,18 @@ def tabs_callback(request: HttpRequest) -> list[dict[str, Any]]:
4444
"active": True # Configure active tab
4545
# "active": lambda request: True
4646
},
47+
{
48+
"title": _("Inline tab"),
49+
"link": reverse_lazy("admin:app_label_model_name_changelist"),
50+
"inline": "corresponding-fragment-url"
51+
},
4752
],
4853
},
4954
],
5055
```
5156

57+
**Note:** For rendering tabs associated with inlines, you should use the `inline` parameter and set its value to the corresponding inline fragment URL. This ensures that the tab correctly links to and displays the inline content when clicked. The inline fragment URL typically corresponds to the slugified verbose name of the inline model.
58+
5259
## Rendering tabs in custom templates
5360

5461
Unfold provides a `tab_list` template tag which can be used to render tabs in custom templates. The only required argument is the `page` name which is defined in `TABS` structure on particular tab navigation. Configure `page` key to something unique and then use `tab_list` template tag in your custom template where the first parameter is the unique `page` name.

0 commit comments

Comments
 (0)