divio / aldryn-search

Haystack 2.0 search index for django CMS
Other
48 stars 77 forks source link

How to show preview and link to Django CMS Page? #91

Open pinksharpii opened 5 years ago

pinksharpii commented 5 years ago

I'm using this plugin to add search to a client site. It successfully searches CMS Pages, Aldryn Blog Posts, and my custom Location "pages". The Blog output looks great - links to the blog post and shows the Lead In.

However, with CMS Pages, the {{ result.object.get_absolute_url }} as noted in the Haystack documentation, doesn't produce any value, when trying to link to the page. Also how can we get a description for the page? I assume it pulls the Meta Description on the page? I try using {{ result.object.body }} like in the documentation but it's nothing.

alexandrenorman commented 5 years ago

In my templates, this works : {% page_url result.object.id %}