Steps to add search portlet in theme and customize that portlet:

1. Open file [LIFRAY_SDK]/themes/{theme-name}/docroot/_diffs/templates/portal_normal.vm

2. Add $theme.search() at your desired location.

3. Build and deploy the theme.

4. A search text box will appear where the code was placed

Steps to customize the search:

In case you need to customize the search functionality to search only specific content types, follow the steps below.

1. Open file [LIFERAY_HOME]/tomcat-6.1/webapps/ROOT/WEB-INF/classes/portal-ext.properties

2. Add following lines:

com.liferay.portlet.blogs.util.BlogsOpenSearchImpl=true

com.liferay.portlet.bookmarks.util.BookmarksOpenSearchImpl=true

com.liferay.portlet.calendar.util.CalendarOpenSearchImpl=true

com.liferay.portlet.directory.util.DirectoryOpenSearchImpl=true

com.liferay.portlet.documentlibrary.util.DLOpenSearchImpl=true

com.liferay.portlet.imagegallery.util.IGOpenSearchImpl=true

com.liferay.portlet.journal.util.JournalOpenSearchImpl=true

com.liferay.portlet.messageboards.util.MBOpenSearchImpl=true

com.liferay.portlet.wiki.util.WikiOpenSearchImpl=true

3. Change values to “false” for those you do not want to include in search result.

For example, to search only “Web Content”, leave “com.liferay.portlet.journal.util.JournalOpenSearchImpl” to “true” and make other values to false.

More Blog Entries

Blogs
Good to See your post Touseef bhai and happy to learn that you are now a Liferay technical Guru. Keep up the Good work and Keep blogging for everyone's benefit.

Ahamed Hasan
Author, Liferay Cookbook
Hello Tauseef,

What if i want to search "group" in respect of its content?
How to customize search functionality to search only in one site? I don't need choice between everywhere and only one site. How to remove everywhere?
Hello , insert the codes into the /webapps/ROOT/WEB-INF/classes/portal-ext.properties , changed the line: com.liferay.portlet.documentlibrary.util.DLOpenSearchImpl = false

and the portal continues looking within document library

something else I can do ?
dear tauseef

i noticed in different posts that ur advising on customising the search portlet.

could you please write in detail what should i do to change the default text of the search portlet.


thank you