Questions tagged [wagtail]

Wagtail is a Django content management system (CMS), focused on flexibility and user experience. When using this tag, you may also want to add the [django] tag to improve visibility.

Wagtail is a content management system built originally for the Royal College of Art and focused on flexibility and user experience.

Its features include:

  • A fast, attractive editor interface
  • Complete control over design with standard Django templates
  • Configure content types through standard Django models
  • Tightly integrated search (with an Elasticsearch backend for production)
  • Strong document and image management
  • Wide support for embedded content
  • Simple, configurable permissions
  • Support for tree-based content organisation
  • Optional preview->submit->approve workflow
  • Fast out of the box. Varnish-friendly if you need it

Useful links

2300 questions
7
votes
1 answer

How to use InlinePanel in ModelAdmin?

I'm setting up a model that needs to be created with a number of instances of a sub-model. I want to be able to edit and create this model in the admin interface so I'm adding it using ModelAdmin. According to the documentation I should be able to…
Dekker1
  • 5,565
  • 25
  • 33
7
votes
2 answers

add/modify blocks value in wagtail streamfield from shell

I have a page with one StreamField body and a custom block named HeadingBlock: class HeadingBlock(blocks.StructBlock): heading = blocks.CharBlock() cssid = blocks.CharBlock() ... class CustomPage(Page): ... body = StreamField([ …
7
votes
1 answer

Wagtail: Filter results of an InlinePanel ForeignKey

These models allow me to establish multiple human "editors" for a tool: class ToolPageEditors(models.Model): person = models.ForeignKey('people.UserProfile') page = ParentalKey('ToolPage', related_name='toolpage_editors') class…
shacker
  • 14,712
  • 8
  • 89
  • 89
7
votes
1 answer

Wagtail, how do I populate the choices in a ChoiceBlock from a different model?

This is the model for icons displayed on top of a text, they get a name and the icon. from django.db import models from django.utils.translation import ugettext as _ from django.conf import settings class SomeSortOfIcon(models.Model): name =…
Ozymandias
  • 199
  • 6
  • 17
7
votes
1 answer

How to solve Wagtail cyclic Block dependency when using a StreamBlock

I would like to achieve something like this, from wagtail.wagtailcore.blocks import StreamBlock, StructBlock class CarouselBlock(StructBlock): content = StreamBlock([ ('tab', TabBlock()), ('carousel', CarouselBlock()) …
Mevin Babu
  • 2,405
  • 21
  • 34
7
votes
1 answer

Use of StreamField in Snippets on Wagtail

I am trying to build some structured snippets on my Wagtail site. I looked through the documentation, but saw nothing on this point (forgive me if I missed it). Is it possible to use StreamField inside of a Snippet? Or, only on Pages
Adam Hopkins
  • 6,837
  • 6
  • 32
  • 52
7
votes
5 answers

Wagtail: Get previous or next sibling

I'm creating a page with wagtail where I need to know the previous and next sibling of the current page: In my portrait page model, I tried to define two methods to find the correct urls, but I'm missing a crucial part. To get the first sibling, I…
nils
  • 25,734
  • 5
  • 70
  • 79
7
votes
5 answers

Migration error with Django 1.7.1

I'm getting an error when performing a migration after introducing a new app (django-allauth). I'm not sure what else to try in order to fix the error. I've tried a few things but they don't seem to help unfortunately. when running manage.py…
AndrewO
  • 1,105
  • 4
  • 16
  • 33
7
votes
2 answers

How to change django wagtail's admin logo

I am working on a small project and I thought I'd give wagtail a try. I am now wondering how I could change wagtail's admin logo in the sidebar (top left image on the picture bellow). I could change /static/wagtailadmin/images/wagtail-logo.svg…
GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
6
votes
1 answer

How to add conditional fields programmatically to a wagtail page type?

I’m trying to add a conditional field to a wagtail page type model, the conditional fields may look like as shown in the below image. There are two fields, Question and Answer. The Answer field values should be displayed with respect to the…
Lalas M
  • 1,116
  • 1
  • 12
  • 29
6
votes
1 answer

Creating Page object programmatically got error ValidationError path and depth fields cannot be blank/null

I am trying to programmatically create a PostPage object. This class inherits from wagtail's Page model: post = PostPage.objects.create( title='Dummy', intro='This is just for testing dummy', body='Lorem ipsum dolor...', …
lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228
6
votes
1 answer

Supplying StreamField with default value in Wagtail admin interface

By default, wagtail's StreamField looks something like this in the admin for empty fields, showing the different blocks available for the user: I would however prefer it to contain a block of my choosing by default. For example: How would I…
cwj
  • 2,473
  • 5
  • 28
  • 38
6
votes
1 answer

How to render the user profile avatar image into the wagtail template?

I am creating a blog site using the Wagtail CMS. I would like to display the Author avatar image whenever a new post is published. I am trying to render the image from this /admin/account/change_avatar/ location. I can see the image uploaded here is…
rameshrasaiyan
  • 177
  • 1
  • 9
6
votes
5 answers

How to get the url of the root page in template in Wagtail?

pageurl can do it with a Page object, but I am not sure how to get the root page object.
timkung
  • 99
  • 4
  • 10
6
votes
1 answer

Django-case insensitive string comparison in django template

How to do case insensitive string comparison? In my case , i need to add a class menu_active when topic.title equals page.slug. but,now topic.title= home page.slug = Home so my condition fails nav_bar.html {% for topic in landing_pages %} …
priyanka priya
  • 165
  • 2
  • 9