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

  • SEARCH
  • Home
  • 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 7399231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:01:59+00:00 2026-05-29T04:01:59+00:00

NOTE Due to the successful outcome of this thread, the documentation at the provided

  • 0

NOTE

Due to the successful outcome of this thread, the documentation at the provided link has been updated. It no longer contains the incomplete information as described.

I’m having an issue taking viewlets that appear in the plone.portalheader viewletManager and adding them to specific locations (not utilizing the linear concatenation). My goal is to make the html code look identical to my html template mockup. I do not want nor require the viewlets to change positions and I would like to see a couple of those elements wind up in the same overarching markup.

I have been reading the following documentation, but it seems to be in conflict with my set up (which is Plone 4.1):

http://collective-docs.readthedocs.org/en/latest/views/viewlets.html#rendering-viewlets-with-accurate-layout

I’m not sure if that particular page is outdated or incorrect (it looks like most references to "tab" were replaced with spaces. eg, <table> is now < le>) or if I’m doing something wrong (which I wouldn’t put it past me).

It looks like when I want to call the new header created from the example, citing something.header fails inside my portal_header.pt file. If someone can eyeball the example and let me know if there are any important parts missing, that would be a huge help to me.

Including my code:

theme/browser/configure.zcml (portion):

<!-- The portal header -->
<browser:viewlet
    name="plone.header"
    manager="plone.app.layout.viewlets.interfaces.IPortalTop"
    layer=".interfaces.IThemeSpecific"
    class=".header.HeaderViewlet"
    template="templates/portal_header.pt"
    permission="zope2.View"
    />

theme/browser/templates/portal_header.pt:

<header>
    <div class="container_12">
        <div tal:replace="structure provider:theme.header" />
    </div>
</header>

theme/browser/header.py:

from Acquisition import aq_inner
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.viewlets import common as base
#import plonetheme.something.browser.viewlets.common as something #left over from original article

def render_viewlet(factory, context, request):
    context = aq_inner(context)
    viewlet = factory(context, request, None, None).__of__(context)
    viewlet.update()
    return viewlet.render()


class HeaderViewlet(base.ViewletBase):
    index = ViewPageTemplateFile('header_items.pt')

    def update(self):
        base.ViewletBase.update(self)
        self.subviewlets = {}

    def renderViewlet(self, viewlet_class):
        return render_viewlet(viewlet_class, self.context, self.request)


    def render(self):
        self.subviewlets["logo"] = self.renderViewlet(base.LogoViewlet)
        self.subviewlets["search"] = self.renderViewlet(base.SearchBoxViewlet)
        return self.index()

theme/browser/header_items.pt:

<header>
    <div class="container_12">
<div tal:replace="structure view/subviewlets/logo" />

<div tal:replace="structure view/subviewlets/search" />
    </div>
</header

That’s all I have modified per the article I listed above. I’m unsure if I should modify viewlets.xml.

From what I understand of the article, it wants to override and replace the plone.portalheader in portal_header.pt with theme.header by utilizing the class provided in header.py. However, I’m not modifying viewlets.xml which is where I believe the problem lies. Or it could like with the fact that I’m replacing plone.portalheader with theme.header and I’m not changing the name of the viewlet in configure.zcml from plone.header to theme.header.

I’ve tried a whole bunch of permutations on what I believe to be the solution and I can’t get anything to work, even trying to modify viewlets.xml.

When I follow the example I get an error message that says:

ContentProviderLookupError(u'theme.header',)
  • 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-29T04:02:00+00:00Added an answer on May 29, 2026 at 4:02 am

    TAL provider: expression will only render portlet managers or viewlet managers. It does not work with viewlets. That’s why there is render_viewlet(factory, context, request) shortcut in the example.

    What you want to is to

    • create a viewlet which contains all of your layout (done, HeaderViewlet)

    • place this viewlet in good known viewlet manager (use /@@manage-viewlet to figure out which) – this is not done

    • then in this new viewlet render subviewlets as you do

    If you need to create a new viewlet manager (ugh, pain in the ass and shitty job) you can follow instructions here:

    http://opensourcehacker.com/2011/11/29/creating-a-viewlet-manager-in-plone/

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

Sidebar

Related Questions

NOTE: This question has been renamed. Originally it targeted the fact that I was
NOTE: This is an old question and the answers here no longer works (since
Note: This question originally applied to Xapian , but due to cross-platform issues and
NOTE: I have changed the details provided due to comments provided. The new technical
Note, this is not a duplicate of .prop() vs .attr() ; that question refers
(Note: This is not a question about what is the best way with code
Note: Not sure if this is the right stack, please tell if I should
NOTE: This is a followup to my question here. I have a program that
Note: I understand this is not strictly about development, but in the earlier threads
EDIT: Note that due to the way hard drives actually write data, none of

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.