feincms / feincms-elephantblog

A blog for FeinCMS
feinheit.ch/labs/
BSD 3-Clause "New" or "Revised" License
43 stars 38 forks source link

`entry.first_image` and `entry.first_richtext` parameters not available in the `ArchiveIndexView` #60

Closed satadev closed 6 years ago

satadev commented 7 years ago

Context

Environment Django==1.11 FeinCMS==1.13.1 feincms-elephantblog==1.1.0 Url / View ArchiveIndexView Template entry_archive.html

Description

The first_image and first_richtext parameters are not available in the ArchiveIndexView As a result, they do not render in the entry_archive.html template. However, the content can still be accessed via the mediafilecontent_set and richtextcontent_set parameters. Therefore, the following does work:

{% if entry.mediafilecontent_set.first %}{{ entry.mediafilecontent_set.first.render }{% endif %}
{% if entry.richtextcontent_set.first %}{{ entry.richtextcontent_set.first.render }}{% endif %}

Please verify and update accordingly. Thank you for your time.

satadev

sspross commented 7 years ago

Sorry @matthiask, I don't have time to look into it atm. But there is something wrong in https://github.com/feincms/feincms-elephantblog/blob/master/elephantblog/views.py#L137 after upgrading Django from 1.10 to 1.11. Best regards, Silvan

matthiask commented 7 years ago

Does upgrading to FeinCMS 1.13.2 or better fix the issue? I'm not sure I remember all the details but I think this should fix it: https://github.com/feincms/feincms/commit/3c5eee07d957d970652b8d4c9438f3a4057f3b9f

sspross commented 6 years ago

yes, upgrading to feincms 1.13.4 solves it. thank you very much.

satadev commented 6 years ago

awesome! thank you <3