django - Wagtail Image template tags -


i'm using django-variant cms wagtail , trying build own templates it.

i can upload images rich text field in wagtail's cms shown:

enter image description here

in template's html, able call specific images uploaded in body can style specific images differently js. perhaps {{ body.image }}?

the html:

{% extends 'wagweb/base.html' %}  {% load rich_text static compress cache image_tags pageurl %}  {% block content %} <div class="box"> <article class ="content">          {{ self.body | richtext }} </article> </div>  {% endblock %} 

i'm lost @ point, can't figure out how find pre-existing tag dictionary (if there any) or create 1 without messing views.py? or more straight-forward install markdown richtextfield , work there?

i'm tons more comfortable html , css, 1 solution write in html , use {{ media_url }} call specific images. seems unintelligent way use wagtail , django.

currently rich text editor doesn't support embedded images custom attributes (like css classes). doesn't provide html source editor richtext field.

however, if don't need have images inline rich text (but rather before or after text, include them in page model using inlinepanel pointing table uses parentalkey. then, in templates, loop through multiple images , apply specialized css classes. wagtail demo project uses method create image carousel. can find explanation on more general tactic of using parentalkey/inlinepanel here in editing api.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -