Add FAQ for opening any url in modal window.

master
Fabio Caccamo 2024-02-14 18:33:32 +01:00
parent 5afe7eb6be
commit 979c8c5c73
1 changed files with 9 additions and 0 deletions

View File

@ -253,6 +253,15 @@ urlpatterns = [
urlpatterns += i18n_patterns(path("admin/", admin.site.urls))
```
### Open any url in modal window
> I have an application with some cross-links in the admin and I would like to open them in modal windows instead of same/new window, how can I do?
You just need to add `_popup=1` query-string parameter to the urls:
```python
url = reverse(f"admin:myapp_mymodel_change", args=[mymodel_instance.pk])
url = f"{url}?_popup=1"
```
## Testing
```bash
# clone repository