Added an hook to load custom css
This commit is contained in:
parent
9879b4b275
commit
bbe5345176
|
@ -46,6 +46,10 @@ class PageAdmin(FlatPageAdmin):
|
|||
}
|
||||
|
||||
class Media:
|
||||
css = {
|
||||
'all': micro_settings.MICROCMS_CUSTOM_CSS
|
||||
}
|
||||
|
||||
js = [micro_settings.CKEDITOR_URL]
|
||||
|
||||
def save_model(self, request, obj, form, change):
|
||||
|
|
|
@ -2,3 +2,8 @@
|
|||
from django.conf import settings
|
||||
|
||||
CKEDITOR_URL = getattr(settings, 'CKEDITOR_URL', 'ckeditor/ckeditor.js')
|
||||
# Default value for custom css is an empty tuple to give greater flexibility.
|
||||
# In yours settings.py you should use:
|
||||
# MICROCMS_CUSTOM_CSS = ('custom-css.css',) # single css file
|
||||
# MICROCMS_CUSTOM_CSS = ('custom-css1.css', 'custom-css2.css') # multiple css
|
||||
MICROCMS_CUSTOM_CSS = getattr(settings, 'MICROCMS_CUSTOM_CSS', ())
|
||||
|
|
Loading…
Reference in New Issue