Add header_image to Article Index Page

This commit is contained in:
PCoder 2022-07-11 18:12:53 +05:30
parent 1abbc707f3
commit 849d539478
2 changed files with 13 additions and 0 deletions

View file

@ -40,6 +40,8 @@ class ArticleIndexPage(Page):
'title_en', 'title_en',
) )
header_image = ImageChooserBlock(required=False)
intro_de = RichTextField(default='', blank=True) intro_de = RichTextField(default='', blank=True)
intro_fr = RichTextField(default='', blank=True) intro_fr = RichTextField(default='', blank=True)
intro_en = RichTextField(default='', blank=True) intro_en = RichTextField(default='', blank=True)
@ -73,6 +75,7 @@ class ArticleIndexPage(Page):
FieldPanel('intro_fr'), FieldPanel('intro_fr'),
FieldPanel('title_en'), FieldPanel('title_en'),
FieldPanel('intro_en'), FieldPanel('intro_en'),
ImageChooserPanel('header_image'),
ImageChooserPanel('feed_image'), ImageChooserPanel('feed_image'),
MultiFieldPanel( MultiFieldPanel(
[ [

View file

@ -16,7 +16,17 @@
</section> </section>
{% else %} {% else %}
{% if page.header_image %}
<div id="carousel-banner" class="slide">
<div class="carousel-inner slick slick-initialized slick-slider" role="listbox">
<div class="slick-list draggable" tabindex="0"><div class="slick-track" style="opacity: 1; width: 1908px;"><div class="item slick-slide slick-active" data-slick-index="0" style="width: 1908px; position: relative; left: 0px; top: 0px; z-index: 900; opacity: 1;">
<img style="background-image:url({{page.header_image}})">
</div></div></div>
</div>
</div>
{% endif %}
<section id="article-index" class="article-index-page"> <section id="article-index" class="article-index-page">
<div class="container"> <div class="container">
<h2>{{ page.trans_title }}</h2> <h2>{{ page.trans_title }}</h2>