Adding a new Container in the HopePage (index.html) or a Portlet

Hi,

In a Plone4 customized instance i'd like to add a Portlet on the HomePage below some already existing sections, is there a way to do that ?

In alternative, it could be useful to add a new Container and link it to some Folder with a Thumbnail type View, or link it to a normal Page so that users can manage the content dynamically and autonomously.

What would be the feasible/best option, and what would be the procedure to do that ?

Probably (Depending on where you want the portlet) you can add a portlet manager.

I made something once that should work:

(there should also be 'belowcontentportlets' in the same add on.


Other options are:

  • Move the content of a portlet with diazo
  • in a browser view either <div tal:replace='structure or /path/to/conent/@@another_view or ajax_view
  • pat-inject or pat-contentload (pat-inject can load content 'automagically, pat-contentload needs a click (or a javascript 'clicking)... I think)

PS: Sometimes you can get away with a 'all contents view' on a smart folder (Collection)

1 Like

Hi Espen,

Thanks for replying.

My Site already has Products.ContentWellPortlets Add-On deployed, thought the current customization of the Diazo Theme seems to have moved the “Manage Portlet” link into the right sidebar at the bottom and i don’t have anymore an “Add, edit or remove a portlet below the content” link below the Main content in the HomePage.

As you can see from the screenshot above, the “Manage Portlet” is now in the bottom of the right sidebar.

This is not really a problem, since clicking it still brings up the the general Portlet Manager configuration page as in the screenshot below:

If i use the “Manage Portlet” and add a Portlet Below the Content, the added Portlet is:

  • NOT shown only in the HomePage, where i need it to be

  • shown inside the all other pages, but not between the main content and the footer, but instead located directly inside the main content, as seen here:

Re-Introducing the default behaviour of the Plone 4 in this case might be enough for me,
so just being able to add a Portlet Well A-B-C and so on, between the Main Content and the Footer, and not having it added inside every page, but only inside the HomePage.

In the following screenshot you can see exactly what we need, and it was done using a demo site with a default plone 4 deploy, which i assume, also has a Portlet Manager already in:

In the test above we added that "Raw projects portlet" that was added by Plone between the main page content and the footer content.

In our current Diazo them (uses a foundation.css) this is not happening and the portlet below content is added in what seems to be the area designed for the main content.

How/where can i change the position where the Portlet Below Contet is added ?

Does this require modifying my CSS, index.html template and rules.xml ?

You probably have set the portlet on the 'root' folder, not the 'default page',
So instead of a URL similar to this
http://mysite/news/@@manage-portlets, you should (or should not) use something like:
http://mysite/news/default_view_of_news/@@manage-portlets

Difficult to tell if it is the wrong place, it could be moved with diazo, it could be the CSS, or it could be that you could use the 'footer portlets'.

I have never used ConteWellPortlets (it was just too many options, so I made my own), so about that product you need to ask someone else (try the plone chat channel)

Hi espenmn,

I tried using your package, but after adding medialog.abovecontentportlets in the eggs of the buildout.cfg i got this error after building and when try to run Plone/Zope:

==> var/log/worker-stdout---supervisor-5EerAZ.log <==
Traceback (most recent call last):
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
    run()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/__init__.py", line 259, in startZope
    Zope2.startup()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/App/startup.py", line 118, in startup
    load_zcml()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/App/startup.py", line 52, in load_zcml
    load_site()
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/Zope2/App/zcml.py", line 46, in load_site
    _context = xmlconfig.file(site_zcml)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 649, in file
    include(context, name, package)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/xxxx/xxx/xxx/my.package/eggs/Zope2-2.13.15-py2.7.egg/OFS/metaconfigure.py", line 46, in loadProducts
    xmlconfig.include(_context, zcml, package=product)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/xxxx/xxx/xxx/my.package/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 104, in includePluginsDirective
    includeZCMLGroup(_context, info, filename)
  File "/xxxx/xxx/xxx/my.package/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
    include(_context, filename, includable_package)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 705, in finish
    args = toargs(context, *self.argdata)
  File "/xxxx/xxx/xxx/my.package/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 1417, in toargs
    raise ConfigurationError("Unrecognized parameters:", *data)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/xxxx/xxx/xxx/my.package/parts/worker/etc/site.zcml", line 16.2-16.23
    ZopeXMLConfigurationError: File "/xxxx/xxx/xxx/my.package/eggs/Products.CMFPlone-4.2.0.1-py2.7.egg/Products/CMFPlone/configure.zcml", line 102.4-106.10
    ZopeXMLConfigurationError: File "/xxxx/xxx/xxx/my.package/eggs/medialog.abovecontentportlets-1.0-py2.7.egg/medialog/abovecontentportlets/configure.zcml", line 18.2-25.8
    ConfigurationError: ('Unrecognized parameters:', 'post_handler')

Do you have any clue of what could be missing ?

Thanks !

The add-on was made for Plone 5, not sure if it works with Phone 4, but you could try to remove line 24 from:

medialog/abovecontentportlets/configure.zcml"

@espenmn:

Thanks for your support !

Yes, removing that line makes it work on Plone 4, i tested it and it is OK !

Still.. i can't solve my issue, your nice module works in a way that is specular to the ContentPortletWells and the position of the Portlet Below Content is still in the same place:

As you can see the "Add, edit or remove a portlet below the content" link position, and also rendered portlet zone, is still inside the gray area of the pages.

What i need is definitively the Below Content zone to be between the main content and the footer, and of course be able to assign portlets there... the portlet assignment works both with your module and ContentWells...

sadly, i cannot understand where/what to look inside the main foundation.css
i also inspected the rules.xml but i was not able to find/recognize where to configure the below content area....

Adding also the Manage Viewlets screenshot to give a better idea:

What i need is to have the whole ViewletManager: plone.belowcontent (plone.app.layout.viewlets.interfaces.IBelowContent) area below the light gray background area, that is between the main content and the Footer (Footer begins after the last dark gray thick line).

You can not (or at least: you should not) move the ViewletManager.

The easiest way would be to just move the viewlet to another ViewletManager.

If I remember right you will have to change this line:

PS: inside the viewlet manager you can use the arrows to move things up and down

@espenmn thanks for your reply.

Unfortunately i'm still not getting this... i'm sorry.

The other available ViewletManager where to hypotetically move the View Below Content are already positioned in places where i don't need to add the content i need.

What i'm trying to achieve is either to have a new container located between the Main Content and the Footer,
and to be able to render some content there, like a Page or a Portlet,
or to have the entire ViewletManager: plone.belowcontent positioned out from the CSS section of the main content.

With the actual setup, any portlet i add as Portlet Below Content, 1) is not shown in the HomePage,
but 2) it is shown in every other page.

Yes i'm aware i can hide the added Portlets in all of the other pages, but since i need it only in the HomePage but its not showing up there, i honestly don't know what to do.

So far, both using your module or ContentWells i'm unable to do this or haven't yet understand how.

I'm deeply sorry if my explanations seems poor, i hope you understood what i'm trying to do.

Thanks,
Regards

K

It looks like you are (still) adding the portlets to the root folder, and not the front-page itself.

Is the front-page a 'normal plone page'?, can you edit it (and does the url show up like http://mysite/front-page/edit

If so, what happens if you go to
http::/mysite/front-page/@@manage-portlets

and add some portlets there ?

I reckon that in this customized Plone 4, the Front Page is not a normal Plone Page.

If i browse http://mysite/front-page what i see is the "Welcome To Plone" page.

But that page is not the HomePage.

If i had a normal page as the HomePage then i could add Portlets there of course, like on any other regular Page, but it looks like this is not the case for this portal.

By the way you can see how the Home Page looks like here:

http://demo.plumi.org/

The Front-Page you're talking about instead its this http://demo.plumi.org/front-page

The skin code (if you want to have a look) its there:

I can not 'make out what is done here', but I am pretty sure the front-page is not 'correct made'.

It needs to be 'Plone content' to use 'manage viewlets etc',

Your problem is NOT the viewlet mangers, probably not the theme, but I would guess you need to fix how the front page was made.

(probably someone was lazy and just 'copied some html into a file... overriding Plone)