Combination View Flat View Tree View
Threads [ Previous | Next ]
Showing 1 - 20 of 21 results.
of 2
Christianto Sahat
Add portlet above navigation header
September 8, 2008 12:18 AM
Answer

Christianto Sahat

Rank: Regular Member

Posts: 175

Join Date: September 24, 2007

Recent Posts

Hi all,

Is it possible to add portlet above the navigation header ( block with Home Products Services Partners... ) menu ? If possible, do I have to modify the theme or layout ?
I want to be able to put article above the navigation header, for example advertisement, etc.

Thanks in advance.
Tobias Amon
RE: Add portlet above navigation header
September 8, 2008 1:09 AM
Answer

Tobias Amon

Rank: Liferay Master

Posts: 549

Join Date: August 8, 2007

Recent Posts

Hello,

you can have a look at the liferay-jedi-theme --> Link

It has a static journal article at the bottom.
 1
 2<div class="footer-award-images">
 3                #set ($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService"))
 4
 5                #set ($journalArticleId = $theme_settings.getProperty("footer-article-id"))
 6
 7                #if ($journalArticleLocalService.hasArticle($guestGroup.getGroupId(), $journalArticleId))
 8                    $velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")
 9                    $velocityPortletPreferences.setValue("group-id", "$guestGroup.getGroupId()")
10                    $velocityPortletPreferences.setValue("article-id", $journalArticleId)
11
12                    $theme.runtime("56_INSTANCE_a453", "", $velocityPortletPreferences.toString())
13
14                    $velocityPortletPreferences.reset()
15                #end
16            </div>
Ray Augé
RE: Add portlet above navigation header
September 9, 2008 3:03 PM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

In 5.1.x, and in 5.1.2 you are able to do this much more easily via:

1#set ($journalContent = $journalContentUtil.getContent($groupId, "MY_ARTICLE_ID", $locale.toString(), $xmlRequest))
2$journalContent
Christianto Sahat
RE: Add portlet above navigation header
September 10, 2008 9:13 AM
Answer

Christianto Sahat

Rank: Regular Member

Posts: 175

Join Date: September 24, 2007

Recent Posts

Thanks Tobias, Ray,

But is it possible that I moved the header to layout, so the header is easily drag and drop anywhere on the page. so the theme just a blank theme. And I can put the article above the header easily by drag and drop.
Because that solution that you offered tied me to hardcode the article ID inside the theme, and this is not user friendly, since my user is not a technical user.



Ray Augé:
In 5.1.x, and in 5.1.2 you are able to do this much more easily via:

1#set ($journalContent = $journalContentUtil.getContent($groupId, "MY_ARTICLE_ID", $locale.toString(), $xmlRequest))
2$journalContent
Gnaniyar Zubair
RE: Add portlet above navigation header
September 10, 2008 9:31 PM
Answer

Gnaniyar Zubair

Rank: Liferay Master

Posts: 603

Join Date: December 19, 2007

Recent Posts

Hi Ray,

As you said, i have given this below code in portal_normal.vm file . my article id also 12108. but it is not affecting.

1#set ($journalContent = $journalContentUtil.getContent($groupId, "12108", $locale.toString(), $xmlRequest))
2$journalContent


But before navigation i got this line only in screen : $journalContent ( attached screen shots)

Pls clarify?
Attachment

Attachments: Screenshot.png (54.5k)
Ray Augé
Re: [Liferay Forums][4. Custom Theme Development] RE: Add portlet above nav
September 11, 2008 5:48 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

> 1#set ($journalContent = $journalContentUtil.getContent($groupId,
> "12108", $locale.toString(), $xmlRequest))
> 2$journalContent


Ok, couple things to check...

1 - check your portal version (you need 5.1.x >= revision #20079)
2- $groupId resolves to the current Community you are in (and not the groupId of the article)... you might want to be explicit for this field as this won't work on non-community pages.

HTH!
hameethun nihar
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Add portlet above
September 18, 2008 9:40 PM
Answer

hameethun nihar

Rank: New Member

Posts: 4

Join Date: August 5, 2008

Recent Posts

Hi All,

I have successfully added the journal content portlet in the footer and also article appears.
The code used is as follows:
in portal-normal.vm
<div id="footer">

#set ($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService"))

#set ($journalArticleId = $theme_settings.getProperty("footer-article-id"))

$velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")

$velocityPortletPreferences.setValue("group-id", "$guestGroup.getGroupId()")

$velocityPortletPreferences.setValue("article-id", $journalArticleId )

$theme.runtime("56_INSTANCE_AJVK", "", $velocityPortletPreferences.toString())

$velocityPortletPreferences.reset()

</div>


But the problem is it appears only on the page it is been added and on the other pages it say
"11404 is expired, is not approved, does not have any content, or no longer exists."



Please give me the solution.
Daniel Bleisteiner
RE: Add portlet above navigation header
September 22, 2008 8:01 AM
Answer

Daniel Bleisteiner

Rank: New Member

Posts: 16

Join Date: June 17, 2008

Recent Posts

These examples all refer to the article portlet. Is there a more general way to add some reserved space inside a theme - outside a layout - for any portlet? In my case I want to place a special login portlet from our portal in an area not part of the layout.
Christianto Sahat
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Add portlet above
October 20, 2008 11:58 PM
Answer

Christianto Sahat

Rank: Regular Member

Posts: 175

Join Date: September 24, 2007

Recent Posts

Ray Augé:
> 1#set ($journalContent = $journalContentUtil.getContent($groupId,
> "12108", $locale.toString(), $xmlRequest))
> 2$journalContent


Ok, couple things to check...

1 - check your portal version (you need 5.1.x >= revision #20079)
2- $groupId resolves to the current Community you are in (and not the groupId of the article)... you might want to be explicit for this field as this won't work on non-community pages.

HTH!


Hi Ray,

I use Liferay 5.1.1, so this solution should be working. But still I have problem to display Journal article on theme.


#set ($journalContent = $journalContentUtil.getContent($groupId, "12108", $locale.toString(), $xmlRequest))
$journalContent

With the above solution, I can only get string $journalContent displayed on my theme. How to get groupId of current community ? The condition is : user is not login, so I think the community is 'Guest' community, and I can't get groupId through $user variable, since it will be null whenever user is not login.

Thanks in advance.
Imre Széll
RE: Add portlet above navigation header
November 9, 2008 3:21 AM
Answer

Imre Széll

Rank: New Member

Posts: 1

Join Date: November 9, 2008

Recent Posts

Gnaniyar Zubair:
Hi Ray,

As you said, i have given this below code in portal_normal.vm file . my article id also 12108. but it is not affecting.

1#set ($journalContent = $journalContentUtil.getContent($groupId, "12108", $locale.toString(), $xmlRequest))
2$journalContent


But before navigation i got this line only in screen : $journalContent ( attached screen shots)

Pls clarify?


Hi!

I had the same problem. Removing the quotation marks around the number solved the problem. (In case of groupId, Liferay 5.1.2).
My code looks like this (in a theme portal_normal.vm):
1#set ($journalArticleId = $theme_settings.getProperty("footer-article-id"))
2#set ($journalContent = $journalContentUtil.getContent(10122, $journalArticleId, $locale.toString(), $xmlRequest))
3$journalContent
Michal Selmeci
RE: Add portlet above navigation header
November 9, 2008 6:25 AM
Answer

Michal Selmeci

Rank: New Member

Posts: 10

Join Date: October 12, 2008

Recent Posts

You can add the portlet anywhere on your page just adding this command in your template:

$theme.runtime("PORTLET_ID")

Where PORTLET_ID is an ID of the portlet you want to add. It has some other parameters which I don't remember. See in spec if you want emoticon

Michal
delang j
RE: Add portlet above navigation header
November 9, 2008 10:00 AM
Answer

delang j

Rank: Regular Member

Posts: 223

Join Date: July 13, 2008

Recent Posts

what about language portlet? and how do i set it's display style to short text?

thanks
delang j
RE: Add portlet above navigation header
November 11, 2008 6:07 AM
Answer

delang j

Rank: Regular Member

Posts: 223

Join Date: July 13, 2008

Recent Posts

Michal, could you explain more details please
delang j
RE: Add portlet above navigation header
November 14, 2008 4:09 AM
Answer

delang j

Rank: Regular Member

Posts: 223

Join Date: July 13, 2008

Recent Posts

Michal Selmeci:
You can add the portlet anywhere on your page just adding this command in your template:

$theme.runtime("PORTLET_ID")

Where PORTLET_ID is an ID of the portlet you want to add. It has some other parameters which I don't remember. See in spec if you want emoticon

Michal


i already tested it but it doesn't work properly. Only configuration button works but when i click look and feel button, nothing happen. Anyone know how to solve this?

thanks
Sebastián Gurin
RE: Add portlet above navigation header
October 16, 2009 12:33 PM
Answer

Sebastián Gurin

Rank: Junior Member

Posts: 75

Join Date: June 13, 2007

Recent Posts

delang j:
what about language portlet? and how do i set it's display style to short text?

thanks


as other have said, you can add a portlet with $theme.runtime("portletId") (a number with quotes). You can obtain the desired portlet id lookin at /portal-web/docroot/WEB-INF/liferay-portlet.xml

In the case of the language portlet, you also can simply call $theme.language()

all of this works fine in liferay 4.4.1 in a velocity theme

hope this can help somebody
Sebastián Gurin
RE: Add portlet above navigation header
February 20, 2010 6:13 PM
Answer

Sebastián Gurin

Rank: Junior Member

Posts: 75

Join Date: June 13, 2007

Recent Posts

for adding the language portlet you can use

<span id="themeDockLanguagePortlet">$taglibLiferay.language()</span>

also, in general, as other said, if you know the id of the portlet you want to add, you can do:

<span>$theme.runtime("82")</span>

first is tested on liferay 5.2 and second on liferay 441

good look
Jignesh Shukla
RE: Add portlet above navigation header
January 12, 2012 8:43 AM
Answer

Jignesh Shukla

Rank: New Member

Posts: 9

Join Date: June 6, 2011

Recent Posts

What about liferay 6ee sp2 ?

I see the method signature is different. It now expects one more argument called viewMode(String type).

I tried using following one from my theme velocity template (navigation.vm) file

public JournalArticleDisplay getDisplay(
long groupId, String articleId, String viewMode, String languageId,
ThemeDisplay themeDisplay);

as following :

#set($myContent = $journalContentUtil.getContent($group_id, $prod.articleId,

"view",$locale,$theme_display))

my content = $myContent

But above line prints the value as: $myContent

I checked to see if $journalContentUtil is available from init.vm and it does.

It prints the value as com.liferay.portlet.journalcontent.util.JournalContentImpl@7ab18869

Not sure what's going wrong here. Am I missing anything ?
Jignesh Shukla
RE: Add portlet above navigation header
January 12, 2012 9:55 AM
Answer

Jignesh Shukla

Rank: New Member

Posts: 9

Join Date: June 6, 2011

Recent Posts

I found the problem.

It accepts articleId as string and the value I was passing was in long format. I just changed it to string and it worked.

Thanks
Jignesh
Krati Gupta
RE: Add portlet above navigation header
July 30, 2012 11:01 PM
Answer

Krati Gupta

Rank: Regular Member

Posts: 113

Join Date: December 5, 2008

Recent Posts

Hi,

I have Code works for me but some error , it will be great if u help me in my issue also , the following is the issue :

My Code :

#set ($tabs1URL = $portletURLFactory.create($request, "ABC", $page.getPlid(), "RENDER_PHASE"))
$tabs1URL.setWindowState("maximized")
$tabs1URL.setPortletMode("view")
$tabs1URL.setParameter("tabs1","Basic")

$tabs1URL.setParameter("struts_action", "/ABC/viewSearch")


<form id="fm" action="$tabs1URL" method="post" name="ABC" onsubmit="submitForm(this); return false;">
<input type="textbox" style="height: 24px; width: 200px;" id="uname1" name="uname1" value="People Search" onFocus="if (this.value == 'People Search') { this.value = ''; }" />
<input type="hidden" name="flag" id="flag" value="true"/>
<input type="submit" id="nsubmit" name="nsubmit" value="Search" />
</form>

By applying above code in theme my custom search textbox is coming in theme, but when I search any keyword its show only one result which I have searched from People Search Module .as per my debugging my struts_action is not calling , when i am searching from theme text box .
Showing 1 - 20 of 21 results.
of 2