8000 Added frontend integration topic (#6276) · django-cms/django-cms@7a915f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a915f5

Browse files
authored
Added frontend integration topic (#6276)
1 parent 7d7d433 commit 7a915f5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/topics/frontend-integration.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. _frontend-integration:
2+
3+
####################
4+
Frontend integration
5+
####################
6+
7+
Generally speaking, django CMS is wholly frontend-agnostic. It doesn't care what your site's
8+
frontend is built on or uses.
9+
10+
The exception to this is when editing your site, as the django CMS toolbar and editing controls
11+
use their own frontend code, and this can sometimes affect or be affected by your site's code.
12+
13+
The content reloading introduced in django CMS 3.5 for plugin operations (when
14+
moving/adding/deleting etc) pull markup changes from the server. This may require a JS widget to be
15+
reinitialised, or additional CSS to be loaded, depending on your own frontend set-up.
16+
17+
For example, if using Less.js, you may notice that content loads without expected CSS after plugin saves.
18+
19+
In such a case, you can use the ``cms-content-refresh`` event to take care of that, by adding something like:
20+
21+
.. code-block:: html+django
22+
23+
{% if request.toolbar and request.toolbar.edit_mode_active %}
24+
<script>
25+
CMS.$(window).on('cms-content-refresh', function () {
26+
less.refresh();
27+
});
28+
</script>
29+
{% endif %}
30+
31+
after the toolbar JavaScript.

docs/topics/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ concerned with explaining *how to do things* than with helping you understand
2020
menu_system
2121
commonly_used_plugins
2222
searchdocs
23+
frontend-integration

0 commit comments

Comments
 (0)
0