掲示板

How to add the search portlet to a Liferay 7 theme

thumbnail
7年前 に William Gosse によって更新されました。

How to add the search portlet to a Liferay 7 theme

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
Can someone tell me how to add the search portlet to a Liferay 7 theme. I'm using the styled Freemarker theme as my starting point.

This use to be pretty easy in velocity with 6.2. All I did was add the following:
$theme.search()

I've used velocity a lot in the past but I'm kind of new to Freemarker. It seems similar but still has some differences.

It seems like 7 no longer supports velocity?
thumbnail
7年前 に William Gosse によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme (回答)

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
I finally figured this out :
<@liferay.search/>

Its a freemarker macros similar to how a the breadcumb portlet is added.
thumbnail
7年前 に John Arguedas によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

New Member 投稿: 5 参加年月日: 16/08/30 最新の投稿
Hi, im new to Liferay, im working with themes .ftl , can you tell me where i can find documentation about the available Liferay's functions?
thumbnail
7年前 に Andrew Jardine によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
There are a couple of places to reference. They're a little trickier to find now from where they used to be but here is a link to on of the files.

github.com/liferay/liferay-portal/blob/7.0.x/modules/apps/foundation/frontend-theme/frontend-theme-unstyled/src/main/resources/META-INF/resources/_unstyled/templates/init.ftl

One of the core benefits of using FTL though is that you can use the tag libraries in your templates. Once you get used to the new syntax, you'll never look back.
thumbnail
7年前 に John Arguedas によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

New Member 投稿: 5 参加年月日: 16/08/30 最新の投稿
Thanks for your time. I am looking for functions like:
<@liferay.breadcrumbs />
<@liferay.control_menu />
<@liferay.search/>
...
thumbnail
7年前 に Andrew Jardine によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
The file you are looking for is called FTL_liferay.ftl -- and you can find it in the source tree under modules/apps/foundation/portal-template/portal-template-freemarker/src/main/resources -- or here: https://github.com/liferay/liferay-portal/blob/master/modules/apps/foundation/portal-template/portal-template-freemarker/src/main/resources/FTL_liferay.ftl
thumbnail
7年前 に William Gosse によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme (回答)

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
I added the search portlet to the end of the nav bar with the following in the navigation.ftl file:

<nav class="${nav_css_class} navbar navbar-inverse" id="navigation" role="navigation">
	<h1 class="hide-accessible">&lt;@liferay.language key="navigation" /&gt;</h1>

	<ul class="nav navbar-nav" aria-label="<@liferay.language key=" site-pages"></ul>" role="menubar"&gt;
		&lt;#list nav_items as nav_item&gt;
                    ... normal navbar stuff here
		<!--#list-->
	        <li id="mysearch">
			&lt;@liferay.search/&gt;
		</li>
	
</nav>

添付ファイル:

6年前 に Asmaa Chadouli によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

New Member 投稿: 2 参加年月日: 17/08/30 最新の投稿
I added the search portlet to nav bar in navigation.ftl file,

[<nav class="${nav_css_class}" id="navigation" role="navigation">
<h1 class="hide-accessible"><@liferay.language key="navigation" /></h1>

<ul aria-label="<@liferay.language key="site-pages" />" role="menubar">
<#list nav_items as nav_item>
list.....
</#list>
<li id="mysearch">
<@liferay.search/>
</li>
</ul>
</nav>]

But i still have the problem,portlet search doesn't appear in my page
thumbnail
6年前 に Massimo Bevilacqua によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Regular Member 投稿: 210 参加年月日: 16/12/27 最新の投稿
Hi Asmaa,

could you please paste all your navigation.ftl code?
thumbnail
6年前 に William Gosse によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
See attached file.

添付ファイル:

thumbnail
6年前 に Massimo Bevilacqua によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Regular Member 投稿: 210 参加年月日: 16/12/27 最新の投稿
Hi,

I just copied your code in my navigation.ftl and I can see the search form



but I didn't find this code inside your file:
[<nav class="${nav_css_class}" id="navigation" role="navigation">
<h1 class="hide-accessible">&lt;@liferay.language key="navigation" /&gt;</h1>

<ul aria-label="<@liferay.language key=" site-pages"></ul>" role="menubar"&gt;
&lt;#list nav_items as nav_item&gt;
list.....
<!--#list-->
<li id="mysearch">
&lt;@liferay.search/&gt;
</li>

</nav>]
thumbnail
6年前 に William Gosse によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
That's what you wanted right?
thumbnail
6年前 に Massimo Bevilacqua によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Regular Member 投稿: 210 参加年月日: 16/12/27 最新の投稿
not me emoticon
@Asmaa asked for this!

Actually I asked her code...my mistake I didn't see it did't come from her!
thumbnail
6年前 に William Gosse によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
Sorry I thought you were asking for me
6年前 に Lionel mourad によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

New Member 投稿: 1 参加年月日: 17/08/25 最新の投稿
Me too,i did the same than you,i copied this code to my navigation.ftl file,i see the search portlet in my page
But,i can make the search only when i logged in,i didn't make it as guest user,
I don't knew what i have to do,can it be a configuration problem ?
thumbnail
6年前 に Andrew Jardine によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
You just need to wrap it in an conditional statement that checks if the user is signed in.

&lt;#if is_signed_in&gt;
	&lt;#-- your signed in markup/logic here --&gt;
<!--#if-->
thumbnail
6年前 に Joshua Turner によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

New Member 投稿: 2 参加年月日: 15/08/11 最新の投稿
I can add it to the page through the portal_normal file, but the controls are completely disabled. You can't type in the search field or click the search button.

Interestingly, when I remove it from the portal_normal file, I can't use the control menu to add one to the page either. It acts as if it's already on the page elsewhere.
thumbnail
6年前 に Andrew Jardine によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Strange, That almost sounds like you have a "layer" that is over top of the search field (maybe a z-indexed element whose dimensions are overlapping the portlet?)
5年前 に Eugene Motolov によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

New Member 投稿: 14 参加年月日: 18/01/24 最新の投稿
Can someone tell me how to add the language selector portlet to a Liferay 7 theme. It's has to be simular to this <@liferay.search/> something like <@liferay.language_selector /> but it's not, please help me.
thumbnail
5年前 に Andrew Jardine によって更新されました。

RE: How to add the search portlet to a Liferay 7 theme

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Hi Eugene,

Can you try -- <@liferay.languages /> -- looking at the macros that come out of the box, I think that should do what you need, but if it doesn't, let me know.