Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6666961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:53:00+00:00 2026-05-26T02:53:00+00:00

Im trying to render a cms page, within another page using a custom cms

  • 0

Im trying to render a cms page, within another page using a custom cms plugin.
The this is my plugin class:

class PageInDiv(CMSPlugin):
    page_div = models.ForeignKey(Page, verbose_name= "page")

    def __unicode__(self):
        return self.page_div.get_title()

as you can see all it does is link the plugin to a page then on my cms_plugins.py i have

class PageInDivPlugin(CMSPluginBase):
    model = PageInDiv
    name = _("Page in div")
    render_template = "page.html"
    admin_preview = False

    def render(self, context, instance, placeholder):
        temp = loader.get_template(instance.page_div.get_template())
        html = temp.render(context)
        context.update({
            'html': html,
            'title':instance.page_div.get_title(),
            'placeholder':placeholder,
        })
        return context

as you can see i pass the html for the provided page to the plugin template, then the plugin template is rendered within the page thats hosting the plugin.
The problem i am having is that the placeholder content from the page thats selected via foreignkey is not being rendered ( displayed ).
So my question is, is there a way to render a pages placeholders programatically ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:53:00+00:00Added an answer on May 26, 2026 at 2:53 am

    Just for a moment ignoring the idea of creating a custom plugin in order to do what you describe (ie, render a page’s placeholders programatically), the following might be a viable alternative, depending on what exactly you are trying to achieve…

    You should be able, just in the template for your “outer” cms page (ie, the page within which you want to display the contents of another cms page), to get access to the current page like this:

    {{ request.current_page }}
    

    This is by virtue of the cms page middleware. So taking that a step further, you should be able to access the page’s placeholders like this:

    {% for placeholder in request.current_page.placeholders %}
        {{ placeholder.render }}
    {% endfor %}
    

    That’s one way you could go about rendering a page’s placeholders “inside” another page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render the dictionary content using Django template like this for
Im trying to render a non power of 2 texture using a model class
I'm trying to render a custom Swing component where I've extended the JComponent class.
I'm trying to render a partial ascx view within another view. I have the
I am trying to render a model in Direct3D using DrawIndexedPrimitives . However, I
I'm trying to render a bit of text using Core Graphics APIs and I'm
I am trying to render a complex XML document as webpage(FF only) using a
I'm trying to render a component from withing another component. public override void Render()
I'm trying to render a font using the css property @font-face , in Firefox,
I'm trying to render sliders instead of select components. Each page has several select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.