wagtail

Wagtail: Display a list of child pages inside a parent page

梦想与她 提交于 2019-12-30 17:51:12
问题 In Wagtail CMS, I'm trying to create an index page that will display a list of all its child pages along with a featured image associated with each child page. I have created these two page models in models.py: class IndexPage(Page): intro = RichTextField(blank=True) content_panels = Page.content_panels + [ FieldPanel('intro', classname='full'), ] subpage_types = ['myapp.ItemPage'] class ItemPage(Page): representative_image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, on

How to add an external object as a field panel in Wagtail CMS

房东的猫 提交于 2019-12-25 14:14:50
问题 I've a pre-existing Django project where I started a Wagtail-driven app. In the Django project, I have a model Map which I need to make available also in the wagtail-app. Django-project Map class in model.py class Map(..): Wagtail-app model.py: class Wagtail-appPage(Page): main_image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, on_delete=models.SET_NULL, related_name='+' ) map = models.ForeignKey(Map, related_name="map_set", null=True, blank=True) date = models.DateField

How to add an external object as a field panel in Wagtail CMS

烂漫一生 提交于 2019-12-25 14:12:41
问题 I've a pre-existing Django project where I started a Wagtail-driven app. In the Django project, I have a model Map which I need to make available also in the wagtail-app. Django-project Map class in model.py class Map(..): Wagtail-app model.py: class Wagtail-appPage(Page): main_image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, on_delete=models.SET_NULL, related_name='+' ) map = models.ForeignKey(Map, related_name="map_set", null=True, blank=True) date = models.DateField

How to add custom class in wagtail richtextfiled

六眼飞鱼酱① 提交于 2019-12-25 01:29:41
问题 how can i add button which adds class in hallo.js editor? Here is my code, but it dont works, it ony register fuction in wagtai;s edit interface. In the end I need to add any class to selection or current tag. Mb I can see it in html in someway and add classes manually? (function() { (function(jQuery) { return jQuery.widget('IKS.center', { options: { editable: null, toolbar: null, uuid: '', buttonCssClass: 'center' }, populateToolbar: function(toolbar) { var buttonElement, buttonset;

Menu navigator disappeared after upgrading to Wagtail 2.6 (from 2.5)

耗尽温柔 提交于 2019-12-24 22:26:35
问题 We recently updated our Wagtail site and the page selector drawer is now blank. I don't see any JavaScript errors or server-side errors. Just looking for help on what I should be investigating. I can confirm this doesn't happen on a fresh install of Wagtail 2.5. I've also run fixtree . 来源: https://stackoverflow.com/questions/58137551/menu-navigator-disappeared-after-upgrading-to-wagtail-2-6-from-2-5

Mapping two MEDIA_URLs to the same MEDIA_ROOT

女生的网名这么多〃 提交于 2019-12-24 20:22:53
问题 I’m migrating a website from WordPress to Django/Wagtail. I have all the old WP content in my media directory & it’s all being served appropriately. It would be convenient to map other URLs (specifically /wp-content/ ) to MEDIA_ROOT , for the sake of old media URLs that were hardcoded in the content. So for example a migrated asset now available at //example.com/media/uploads/2017/12/IMG_2120.jpg can also be served from //example.com/wp-content/uploads/2017/12/IMG_2120.jpg I’m sure there’s

Contactform in footer of page

元气小坏坏 提交于 2019-12-24 20:05:04
问题 I have a contactform in the footer of a website. So it is on every page. It works, with one problem: as soon as it is sent, it doesn't show anymore. More specific I guess when my request is no longer empty. @register.inclusion_tag('home/tags/contact.html', takes_context=True) def contact_form(context): request = context['request'] if request.method == 'POST': form = ContactForm(request.POST) if form.is_valid(): subject = form.cleaned_data['naam'] from_email = form.cleaned_data['email']

Wagtail Admin api call for fetching child pages returns 0 in the explorer

≡放荡痞女 提交于 2019-12-24 17:48:00
问题 I updated wagtail to the latest version 2.6.1 from 2.4 and noticed that the API call that fetches child pages for displaying in the ADMIN UI explorer now returns 0 pages. admin/api/v2beta/pages/?child_of=1&for_explorer=1 {meta: {total_count: 0}, items: [], __types: {}} items: [] meta: {total_count: 0} total_count: 0 __types: {} Is there anyway around this? 回答1: This has been reported by a couple of other users on Wagtail 2.6 (see also Menu navigator disappeared after upgrading to Wagtail 2.6

Trouble with Carousel images in Wagtail

丶灬走出姿态 提交于 2019-12-24 10:12:33
问题 I'm relatively new to Django and a complete beginner in Wagtail. The website I am building only has one carousel and it is on the homepage. I have created the following two models in models.py : class CarouselItem(Orderable): image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, on_delete=models.SET_NULL, related_name='+' ) caption = models.CharField(max_length=255, blank=True) page = ParentalKey('HomePage', related_name='carousel_items') panels = [ ImageChooserPanel('image

How to set the project root url when Wagtail is integrated as an app in a Django-project

点点圈 提交于 2019-12-24 08:06:33
问题 I'm integrating Wagtail in a pre-existing Django project. My project tree is as follows: /adjangoproject/ /anapp /blog/ urls.py /anotherapp urls.py My adjangoproject/urls.py urlpatterns = patterns('', url(r'^blog/', include('geonode.blog.urls')), [...] My adjangoproject/blog/urls.py urlpatterns = patterns('', url(r'^cms/', include(wagtailadmin_urls)), url(r'', include(wagtail_urls)), ) While [adjangoproject_rooturl]/blog/cms correctly shows the wagtail admin, the path [adjangoproject_rooturl]