From 3afb7e414c5c79fe0a0fa82a9a7bf2f7fc8fa91f Mon Sep 17 00:00:00 2001 From: Adrien Delhorme Date: Thu, 17 Mar 2022 01:48:33 +0100 Subject: [PATCH] Display page title instead of menu title (#194) * Display page title instead of menu title * Update Changelog Co-authored-by: Adrien Delhorme --- CHANGELOG.rst | 5 +++++ djangocms_link/fields_select2.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9733dabc..02be05cf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog ========= +Unreleased +========== + +* Display page title instead of menu title + 3.0.0 (2020-09-02) ================== diff --git a/djangocms_link/fields_select2.py b/djangocms_link/fields_select2.py index 7e750826..25261013 100644 --- a/djangocms_link/fields_select2.py +++ b/djangocms_link/fields_select2.py @@ -12,6 +12,9 @@ class Select2PageSearchFieldMixin: 'title_set__slug__icontains' ] + def label_from_instance(self, obj): + return obj.get_title() + class Select2PageSelectWidget(Select2PageSearchFieldMixin, ModelSelect2Widget): site = None