Relative Content

Tag Archive for wagtailwagtail-admin

Change the content in the main page depending on whether the user is logged in or not

I am new to wagtail. I found out how to edit the homepage and add HTML contents. But I want the content to depend on whether the user is logged in or not (e.g. if the user is not logged in, write “please log in”, otherwise, write “hello user”). I tried to write the following code, which I found somewhere on the net, in the “html” text-box in the editor:

How to specify `ordering` for Wagtal PageListingViewSet

I’m creating a PageListingViewSet and would like to specify the default ordering in the table view. Previously, the ModelAdmin class (from which I’m migrating our code) allowed me to specify ordering. Likewise, the Wagtail ModelViewSet allows developers to specify ordering. However, the PageListingViewset doesn’t define or inherit from a class that allows ordering to be defined.

How to integrate wagtail 6.1 with django improved user

I was using django-improved-user with Wagtail (up to Wagtail 6.0) and things were working fairly well. With Wagtail 6.1 now, the user listing page errors out because it is trying to order the listing by first name and last name, but the default user model supplied by django improved user does not have those fields. It instead uses full name and short name. Is there a simple way to customize the user listing page to determine which columns to use and how to specify the ordering?