Hi Fosi, In the link Stephen provided, he highlighted lines 22-23 of page.html, in which the reader will notice the block you call `all_content` should be called `main`.
hth. -ken On Wed, Jan 27, 2016 at 7:16 AM, fosi <[email protected]> wrote: > Hello stephen, looking at the page.html and the code pasted, it seems to > me that the defined block is been used. If i'm > missing something kindly point it out to me. Thank you > On Tuesday, January 26, 2016 at 11:56:17 PM UTC+1, Stephen McDonald wrote: >> >> If you're extending a template, don't you need to use the blocks it >> defines? >> >> >> https://github.com/stephenmcd/mezzanine/blob/a84f38c38bdaee0b21c9e9209cec5148ba0ae108/mezzanine/pages/templates/pages/page.html#L22-L23 >> >> On Wed, Jan 27, 2016 at 8:51 AM, fosi <[email protected]> wrote: >> >>> Hello, >>> >>> I created a Homepage that is powered by the admin, the content of the >>> homepage should be Images stacked on each other, after creating my model >>> and index.html template, nothing seems to be coming up even though the >>> block tags are included in base.html. Some help here please >>> >>> here's what my model looks like: >>> #model.py : >>> >>> class HomePage(Page, RichText): >>> ''' >>> A page representing the format of the home page >>> ''' >>> >>> >>> class Meta: >>> verbose_name = _("Home page") >>> verbose_name_plural = _("Home pages") >>> >>> >>> >>> class Gallery(models.Model): >>> homepage = models.ForeignKey("HomePage", blank =True, null=True) >>> image = FileField(verbose_name=_("Image"), >>> upload_to=upload_to("theme.Gallery.image", "gallery") >>> ) >>> >>> def __unicode__(self): >>> return self.image.name >>> >>> >>> and my index.html : >>> >>> {% extends "pages/page.html" %} >>> >>> {% load mezzanine_tags staticfiles %} >>> >>> >>> {% block all_content %} >>> {% if page.homepage.Gallerys.all %} >>> >>> >>> {% for gallery in page.homepage.Gallerys.all %} >>> <img src="{{ MEDIA_URL }}{% thumbnail gallery.image 1920 690 %}"> >>> {% endfor %} >>> >>> >>> {% endif %} >>> {% endblock %} >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Mezzanine Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Stephen McDonald >> http://jupo.org >> > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
