Re: [mezzanine-users] Access FileField in a Page model
I can access 'page.homepage.heading' in the same template. The page.homepage is available in the context, however, just the .featured_image is empty. And checking from the db, that field doesn't exist, but the image shows up in Admin. On Friday, November 20, 2015 at 9:19:43 PM UTC, Kenneth Bolton wrote: > > Hi, > > I think you want to read > http://mezzanine.jupo.org/docs/frequently-asked-questions.html#why-isn-t-the-homepage-a-page-object-i-can-edit-via-the-admin > . > > The first thing is to install Django Debug Toolbar. It will help you see > the context being sent to the templates. You will be able to inspect `page` > and see if it has `homepage`, and if 'homepage' has `featured_image`. > > Those two should get you going. > > -ken > > > > On Fri, Nov 20, 2015 at 2:46 PM, Nkansah Rexford > wrote: > >> I have a field: >> class HomePage(Page): >> featured_image = FileField(verbose_name=_("Featured Image"), >> >> upload_to=upload_to("main.HomePage.featured_image", "homepage"), >>format="Image", max_length=255, >>null=True, blank=True) >> >> >> >> In my templates, what do I do to get the featured_image to show? I've >> loaded mezzanine_tags >> >> According to the Blog Post example (referred to it, because devs here >> love pointing to source code as examples), this is how it was done: >> >> >> >> This is what I have: >> >> >> >> But it doesn't work. According to: >> http://mezzanine.jupo.org/docs/utilities.html#thumbnail, the thumbnail >> should work on my situation. Its not working, >> >> Anything I'm missing? >> >> -- >> 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 mezzanine-use...@googlegroups.com . >> 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Access FileField in a Page model
Hi, I think you want to read http://mezzanine.jupo.org/docs/frequently-asked-questions.html#why-isn-t-the-homepage-a-page-object-i-can-edit-via-the-admin . The first thing is to install Django Debug Toolbar. It will help you see the context being sent to the templates. You will be able to inspect `page` and see if it has `homepage`, and if 'homepage' has `featured_image`. Those two should get you going. -ken On Fri, Nov 20, 2015 at 2:46 PM, Nkansah Rexford wrote: > I have a field: > class HomePage(Page): > featured_image = FileField(verbose_name=_("Featured Image"), > > upload_to=upload_to("main.HomePage.featured_image", "homepage"), >format="Image", max_length=255, >null=True, blank=True) > > > > In my templates, what do I do to get the featured_image to show? I've > loaded mezzanine_tags > > According to the Blog Post example (referred to it, because devs here love > pointing to source code as examples), this is how it was done: > > > > This is what I have: > > > > But it doesn't work. According to: > http://mezzanine.jupo.org/docs/utilities.html#thumbnail, the thumbnail > should work on my situation. Its not working, > > Anything I'm missing? > > -- > 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 mezzanine-users+unsubscr...@googlegroups.com. > 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[mezzanine-users] Access FileField in a Page model
I have a field: class HomePage(Page): featured_image = FileField(verbose_name=_("Featured Image"), upload_to=upload_to("main.HomePage.featured_image", "homepage"), format="Image", max_length=255, null=True, blank=True) In my templates, what do I do to get the featured_image to show? I've loaded mezzanine_tags According to the Blog Post example (referred to it, because devs here love pointing to source code as examples), this is how it was done: This is what I have: But it doesn't work. According to: http://mezzanine.jupo.org/docs/utilities.html#thumbnail, the thumbnail should work on my situation. Its not working, Anything I'm missing? -- 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.