Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] placeholder inherit does not work #410

Open
1 of 2 tasks
aacimov opened this issue Apr 24, 2024 · 5 comments · May be fixed by #411
Open
1 of 2 tasks

[BUG] placeholder inherit does not work #410

aacimov opened this issue Apr 24, 2024 · 5 comments · May be fixed by #411

Comments

@aacimov
Copy link

aacimov commented Apr 24, 2024

Description

I have a placeholder named "Header image" called this way:

{% placeholder "Header image" inherit or %}
        {% include "layouts/_includes/hero.html" %}
{% endplaceholder %}

The point is to inherit a placeholder which has an Image plugin (from parent page on child pages). If there is no plugin added in "Header image" placeholder on the parent page, show a default header image defined in my include template. Parent page has an Image plugin and it should be shown on a child page but it does not.

Both templates (on parent and child) are the same (in my case content.html template).

Steps to reproduce

  1. Add plugin to a parent page placeholder
  2. The placeholder should have inherit or attributes (placeholder "Some name" inherit or) as described at the beginning
  3. Publish the page
  4. Create a subpage
  5. Publish the subpage

Expected behaviour

A child page / subpage should inherit the parent page placeholder.

Actual behaviour

Child page / subpage does not inherit the placeholder but rather shows the included default code chunk (in my case).

As extra info I can add that the parent page is not a homepage, nor has any AppHooks attached - just a regular page. Child page is the first child. I have an example with the same example but with multiple child pages and their subpages (3 levels) - same behavior.

Additional information (CMS/Python/Django versions)

  1. Django 4.2.11
  2. Django CMS 4.1.0
  3. Python 3.10

Do you want to help fix this issue?

  • Yes, I want to help fix this issue and I will join #workgroup-pr-review on Slack to confirm with the community that a PR is welcome.
  • No, I only want to report the issue.
@fsbraun
Copy link
Sponsor Member

fsbraun commented Apr 24, 2024

@aacimov Any idea if this also happens without the or keyword?

@aacimov
Copy link
Author

aacimov commented Apr 25, 2024

It does. Forgot to mention.

@aacimov
Copy link
Author

aacimov commented May 17, 2024

Hey @fsbraun any updates on this one? Not a crucial issue but kind of a DRY principle interruption hehe.

@fsbraun
Copy link
Sponsor Member

fsbraun commented May 17, 2024

@aacimov I have been able to verify that the issue comes from interaction with djangocms-versioining. I keep on investigating.

@fsbraun fsbraun transferred this issue from django-cms/django-cms May 17, 2024
@fsbraun
Copy link
Sponsor Member

fsbraun commented May 17, 2024

Root cause identified:

  • djangocms-versioning overwrites render_obj_placeholder in the ContentRenderer.
  • In the core, the render_obj_placeholder method checks for PageContent objects and delegates to render_page_placeholder.
  • render_page_placeholder implements the inherit functionality but is never called when djangocms-versioning is active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants