How to move searchbar in Plone5

0 votes

I'm new to Plone 5 and I'm actually following the plone training. However, I'm not used to the way that all is build. I would like to do simple things but I don't know where to start. For example:

  • How can I move the search bar from the header to the navbar menu?

  • How can I add an image to the header next to the logo?

  • Is there any tutorial that can help me?

Oct 10, 2018 in Python by eatcodesleeprepeat
• 4,790 points

1 answer to this question.

0 votes

You can install the add-on Products.ContentWellPortlets and replace the top-viewlets with portlets, by adding a portlets.xml in one of your add-on's profiles.

This example adds a logo and an image next to it:

<?xml version ="1.0"?>

 <!-- Assign Logo-portlet to site-root (key='/'): -->
 <assignment name="top" category="context" key="/"
    type="plone.portlet.static.Static" visible="True">

   Give this portlet a name, so we can recognize it easily in the
   portlet-management-UI via `[PLONESITE_URL]/manage-portletsinheader`:
  <property name="header">Logo</property>

  <!-- But don't show its header and footer when viewing the portlet: -->
  <property name="omit_border">True</property>

  <!-- Replace 'Plone' with your site-id here, in case it differs: -->
  <property name="text">
     &lt;a href="/Plone">
       &lt;img src="logo.png" />


 <!-- Assign another portlet in next column (InHeaderPortletManager2): -->
 <assignment name="top" category="context" key="/"
    type="plone.portlet.static.Static" visible="True">
  <property name="header">Some image next to Logo</property>
  <property name="omit_border">True</property>

  <property name="text">
    &lt;img src="defaultUser.png"
        title="Dummy-user-avatar" />



And polish it with some styling.

For the search-box I'd may assign a search-portlet above the content (using ContentWellPortlets), give it a minus-margin-top and for the globnav a margin-right, but as there's many ways to Rome, I'd might replace the globnav with a navigation-portlet, too.

Here's an add-on for illustration-purposes (see its viewlets.xml on how to hide the top-viewlets):

answered Oct 10, 2018 by Priyaj
• 58,140 points

Related Questions In Python

+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
+4 votes
7 answers
0 votes
1 answer

How to hide a window in the constructor immediately after creation?

You can use QtCore.QTimer class Example(QWidget):     def __init__(self, app):         QWidget.__init__(self)         QTimer.singleShot(0, ...READ MORE

answered Apr 17, 2018 in Python by anonymous
+1 vote
12 answers
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,350 views
0 votes
0 answers
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 58,140 points
0 votes
3 answers

How to get the current time in Python


answered Apr 8, 2019 in Python by rajesh
• 1,230 points