Separte view.jsp for each RSS portlet - liferay

I have RSS feeds from 4 different websites grouped logically into two catgeories (Social and educational).I have created 1 RSS portlet for each of the category.Each portlet has link to two URL feeds.
I wanted to customize the look and feel of the feeds while they are displayed.For this I created a hook and modified view.jsp. But what I see is view.jsp changes only takes effect for the 2nd RSS portlet added.
Is there any way I can use the same view.jsp and conditional code for handling display of each of the RSS portlets? Any help would be appreciated. Thanks.

The way you have overridden view.jsp, you can also override configuration.jsp of the rss portlet. You can add one more select box and give it a name like preferences--feedStyle--. Provide number of style options that you want.
This will give you chance to get the configuration to select the style for individual portlet instance of RSS from Portlet configuration.
In the view.jsp, read the portlet configuration and based on that you can display the desired style.

Related

How to edit default portlet in Liferay 7 Control Panel?

Is it possible to edit portlet/page in Control Panel in Liferay 7.0 ga4?
In my case, I want to add a custom column in Users table in 'Users and Organizations' section.
Yes, it's possible, and you do so just like you'd do for any other stock portlet. While there are extra mechanics to make them appear in control panel, you don't need to get in contact with these if you just modify.
Inspect the Dom to get a hint for the portlet that you're looking for.
An alternative that'd be better maintainable would be to write your own portlet instead of modifying an existing one. But that's not what you ask for here.

Placement of portlets on a liferay page

I am using 1-2 Columns (70-30) layout for the page in liferay. The problem that I am facing is that I am not able to place them properly in 1-2 columns form even after dragging them properly on the page. I am making use of web content portlets. The portlet that should be placed on '30' side;its data appears the way I want on the RHS but the portlet window covers the entire screen. How should I place the portlets to get the exact 1-2 columns layout?
EDIT:
Is it possible to place a portlet over another portlet?
If the portlets that you are trying to place are custom portlets, It may be worth checking if custom css width property forcing portlet to occupy more width than supposed.
You can't place one portlet over another portlet. But "Nested Portlet" can be used to include more than one portlet in their own layout.
As you don't have public URL, I can only suggest steps to debug your issue.
Login to portal as Administrator.
Create a new page.
Apply liferay default classic theme to the page and apply 70-30 layout.
Add one Web content display portlet instance in column 1 and another in column 2.
Checkpoint: Enable Edit checkbox and see if the default portlet boundaries are occupying width they are supposed to take. If yes, then your liferay default working fine.
Checkpoint: Select your web content article and see if width of display changes. If Yes, then the problem is with with your web content article.
Checkpoint: Apply your theme and then see the issue. Then issue may be with your custom css files in _diff folder.
Use Firebug in Firefox or chrome dom viewer (F12 in chrome window) and observe which CSS style is causing the issue.

Place portlet under dockbar

I want to do a greetings portlet that will say: Good morning, %username% (Logout). I don't want to place it on dockbar (there is a limit of max characters count per dockbar child and i don't know how to remove that limitation), i want to place it under the dockbar (like in attached picture).
Is it possible? If not - how can i remove limit of max characters in dockbar child?
Using Liferay 6.2.
You can use theme.
You can modify the portal_normal.vm and embed your portlet in theme just like liferay is accessing the dockbar portlet.
Add some custom styles for positioning the portlet and you are good to go.

Is there any way we can display web-content on public page randomly on page refresh?

We are using liferay 6.1
On Public page we want to display web-content in one portlet, but it should not be only selected one.
we want to display it randomly on page refresh. Like on page refresh it should display different web content from group of web content.
Any hint ?
Thanks.
Consider to use structures & templates: With structures you give some contents of an article - this might be alternative content, or just a description of a filter that you want to display.
A simple structure (that contains all of the content in just one article, not exactly what you ask for) just has repeatable HTML text fields. Edit all of them with the content you want to show alternating.
In your template you read an article with this content, generate a random number and only show the fragment from the content that the random number suggests.
Another way is to have a template that queries Liferay's API for several articles. Then you randomly select one of them and display it.
Templates can be written in Velocity, Freemarker or XSL. The nice thing is they're completely runtime-configurable.
Liferay Blogs, particularly those of James Falkner, have a few articles on how to work with the API from templates.
You can customized the "Web Content Display" portlet with a hook.
Add to config-page the "show randomized" checkbox, get the list of existing journal articles and choose random one of them.

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