How to change the Language of portlet's title? - liferay

I am trying to change the language of portlet title, but didn't succeed!
I went through the various link from liferay's forum, but unable to achieve my task.
Example:1
Example:2
Details:
I am using following locales fr_FR and zh_CN,with the following values in the concerned properties file
javax.portlet.title.1_WAR_microblogsportlet=News
javax.portlet.title.1_WAR_microblogsportlet=nouvelles(for fr_FR)
javax.portlet.title.1_WAR_microblogsportlet=新聞(for zh_CN)
resource bundle is set in portlet.xml as given:
<portlet-name>1</portlet-name>
<display-name>Microblogs</display-name>
<portlet-class>com.liferay.microblogs.microblogs.portlet.MicroblogsPortlet</por‌​tlet-class>
<resource-bundle>content.Language</resource-bundle>

You just need to have property with key as "javax.portlet.title", no need to put your portlet ID as part of key.
Name the localized properties files and put property value as below.
Language.properties
javax.portlet.title=News
Language_fr.properties
javax.portlet.title=nouvelles
Language_zh.properties
javax.portlet.title=新聞
Then liferay displays portlet in corresponding language depending on user's locale.
You may test in one of below ways.
For User -
In current user profile -> Display Settings, Select language as French and then visit the page having your portlet. It should display title in french instead of english.
Change in URL
You may also specify locale in page URL as described in liferay 6.1 documentation
http://localhost:8080/fr/<your page url>
Using Language portlet
Add Language portlet on your page and clicking on French flag changes locale to french and the page should display portlet title in French.

Related

JSF pages from Entities Clases

I've a problem when I use de wizard of Netbeans to create "JSF pages from Entities Clases". By default the wizard generate .jsp pages and I need .xhtm pages.
How I can change the type of JSF pages that generate the wizard?
Thanks!!
I've finally been able to solve my problem.
The steps for change the "JSF pages from Entities Clases" defined by default are:
Over the web project --> Click Right bottom--> Propierties.
In categories (on the right) we have to select Frameworks (Java Server Faces).
Now we open the "configuration" tab and choose "Preferred Page Language": "Facelets".
Facelets=.xhtml
For a better explanation see the image below:
facelets.png

How to give a list of sections that will be included as part of the form in Liferay7?

I am migrating from liferay 6.2 to liferay 7 ,here I am getting problem to give the selected list of categories in the form.
Ex:
In the site settings by default we can able to see four different categories and its sub-categories in the form.
which are defined in the portal.properties in the following way
sites.form.update.main=details,categorization,site-url,site-template
sites.form.update.seo=sitemap,robots
sites.form.update.advanced=default-user-associations,staging,analytics,content-sharing,recycle-bin
sites.form.update.miscellaneous=custom-fields,display-settings
1)Basic Information
a)details, b)categorization, c)site-url, d)site-template
2)Search Engine Optimization
a)sitemap, b)robots
3)Advanced
a)default-user-associations, b)staging,analytics, c)content-sharing, d)recycle-bin
4)Miscellaneous
a)custom-fields, b)display-settings
We can include only some specified selected categories based on the role.
In liferay 6.2 we can avhive this by defining in the
portal-ext.properties like the below
#These custom properties are defined for portal admin
sites.form.update.main.admin=details,categorization,site-url,site-template
sites.form.update.seo.admin=sitemap,robots
sites.form.update.advanced.admin=default-user-associations,staging,analytics,content-sharing,recycle-bin
sites.form.update.miscellaneous.admin=custom-fields,display-settings
#These custom properties are defined for portal site admin
sites.form.update.main.siteadmin=details,site-url
sites.form.update.seo.siteadmin=
sites.form.update.advanced.siteadmin=recycle-bin
sites.form.update.miscellaneous.siteadmin=
But How could I achieve the same functionality in Liferay7 ?

Liferay Language switch issue

I am trying to implement multiple language support in my liferay Project. For this i added below code in portal_normal.vmfile of theme.
#set( $availLanguage = $stringUtil.split("hi_IN,en_US"))
<span id="language">$taglibLiferay.language("fm", null, "languageId", $toto, 0)</span>
which will add support for two language Hindi,English (United States).
and created hook for multiple language properties files.
<hook>
<language-properties>content/Language_hi.properties</language-properties>
<language-properties>content/Language_en.properties</language-properties>
</hook>
but whenever i switch my language its not changing.It always shows values from Language_en.properties file
so to check whats happening i tried printing below values in theme
$theme_display.getLanguageId()
$locale
but it always shows en_US even thought i changed language to hi_IN.
Looking for help to figure out whats going wrong.
Environment: Liferay 6.1.1 CE GA2
I think you need to add hi_IN language as Available Languages in Portal Settings if it is already not there.
To add this/or verify go to Control Panel --> Portal Settings --> Display Settings
here you will find a input box Available Languages which shows all available locales (comma seperated), make sure you have entry for hi_IN in this input box.

Set portlet as highlighted on add application panel

Liferay 6.2 CE
How exactly can one go about to set a portlet to show up on the highlighted category on the add application panel? I've been searching for hours, without any luck.
Have tried to define category name as "Highlighted", but it just creates a new one with the same name.
The main goal is just to have my own portlets sit on the top of the rest.
Cheers.
Configure the following settings (here with the defaults) in your portal-ext.properties:
##
## Dockbar Portlet
##
#
# Set the portlet ids that will be shown directly in the "Add Application"
# menu.
#
dockbar.add.portlets=56,101,110,71
Here you see that Liferay has the habit of numbering all the core portlets. Your own portlets ids will be constructed from their plugin name and the portlet id, e.g. the AmazingApp portlet that is deployed in the webapplication my-great-custom-plugins-portlet will have an ID of *amazingapp_WAR_mygreatcustompluginsportlet* (or similar). How can you find this out by yourself? Add it to the page, then choose "Look and Feel" and "Advanced Styling" - this will show the HTML id for your portlet, of which you can easily extract the actual portlet ID to use for portal-ext.properties.

Using a MulitpleLookupField in MOSS '07 Layout Page

I have a page layout for my MOSS '07 site that I want put a MultipleLookupField in. The field will point to a multiple lookup column in my custom content type that points back to the pages library so I can have a "Related Articles" field.
I've gotten the field to show up correctly--it's even editable when the page is in edit mode! But when you click on the link that shows up there, it display the page's properties view instead of the page itself.
There's lots of properties on the control, but there's little documentation at MSFT as to what they do.
Does anyone know how to change the link's URL to the actual page instead of the properties view?
Here's the tag I'm using:
<SharePointWebControls:MultipleLookupField
ID="MultipleLookupField1"
FieldName="RelatedIssues"
runat="server"></SharePointWebControls:MultipleLookupField>
The link takes me to here: /Pages/Forms/DispForm.aspx?ID=6&RootFolder=*
I want it to take me here: /Pages/faq1.aspx
Unfortunately the lookup control is designed to be compatible with generic lists and does not understand that the document libraries have a file with a specific url associated.
You will probably have to find a custom lookup control on the web or roll your own.

Resources