Use a web content portlet - liferay

I am using web content portlet to develop a portal.
Each page has common theme (which includes header and footer) and we have many portlets placed on each page.
One of the portlet on right side is menu which is common on many pages.
I could have kept it as a part of theme but the menu can be subject to change in future and the end user who will be handling the portal is non-developer.
So if they want to change some data in that menu portlet, they will have to change it on every page which leads to duplication of effort.
Like I said, since end user is a non-developer, I cannot make that portlet part of the theme.
So is there any way where one web content portlet be created once and used on many pages?

You can embed web-content in theme as per link
Here articleId as in above link, you can set in theme-setting, refer to link

I have found a solution right now. If anyone has abetter solution than this..they are most welcome. I would like people to share alternate and better solutions
I am using Liferay 6.2
What I did was added a new web content display portlet which like I said created a new blank web content display portlet.
So my usual method was to add content to this portlet. THis was the method I followed. You can click on Select Web Content button and then select the already created portal from the list and you are done. NO need to create duplicate portlets

Related

Call Custom aAction from Liferay Theme

I have A Custom Theme project & A Custom portlet project in liferay.
I want to call a custom action which is in Custom portlet from navigation.vm File of Theme Project.
actionurl is : /c/journal/upload_article which is called from same portlet project successfully.
How to call this from theme project?
Any help is really appreciated.
It sounds weird to "call" an action from a theme. If you embed a form to upload content on every page, naturally, you'd need a target for the upload. But still, the theme seems to be the wrong place to do so.
Nevertheless: It seems that you're using a non-custom URL for uploading (/c/journal/upload_article). You can do so from wherever in HTML. The big question then is: Where will you end up after the upload, as it doesn't happen from within a page.
If you need a proper portlet URL on an individual page, and want to return to the same page, the best way forward is to embed a portlet in the theme (which makes a great search term for Liferay's documentation). From that portlet you can utilize Liferay's API to do what you're trying to achieve. Make it a very lightweight portlet, because, well, it will be embedded on every single page.

How to add preference option to the liferay portlet

I want to create a portlet where the portlet allow access to the remote application. That is the content of the portlet should be dynamic so for the same reason I want to add one option "Preferences" in the portlet (Where the look and feel and configuration options exists). In that preference page If will give some http url (http://localhost:8080/Myapp/Mypage) then on click of save button, the URL page should display in the portlet. How can I do that? Note I am going to use same portlet in different pages with different URLs.
Liferay's "Preferences" link shows the portlet in JSR-286 "edit" mode. That's all there is: If you implement this mode, you'll automatically get the Preferences link.
Why are they named differently? IMHO Edit-Mode is rather misleading as you're editing the preferences rather than any data displayed in the portlet.
You can use Liferay Iframe Portlet which allow access to the remote application.
Refer following url for detail description of look and feel and configuration options : Iframe Portlet

SharePoint 2013, change welcome page layout when a sub site is created

we have a custom page layout, and we want this:
When a new sub site is created by users, we want the default.aspx, AKA welcome page to be based on our custom page layout.
How can we do this?
Two options:
1) Create a custom web template and define a module for the welcome page. This obviously only works for that custom web template, but does not require code.
2) Create a web event receiver (e.g. WebProvisioned), apply it to site collection. In the code behind set the page layout of the welcome page to your custom page layout. This works for any template, but requires custom code.
Option 1 only works in a farm solution, option 2 should also work in a sandboxed solution I guess.
I believe you want this OOTB (Codeless).
Go to page (you want to make home page) set the layout. (you custom
layout).
Set this page as a home page.
Remove all data (lists, libraries, pages). except this page.
Save the site as site template(_layouts/savetmpl.aspx). If you are not finding the save as template option. Write the url.
After saving the template, you can
use the same template for all your sites. For creating subsites,
this should be add in list site template in settings. Let me know, I
can explain you more.
Thanks

Adding pages and templates to a portlet

I am using eclipse ide and I have created a liferay project Test-portlet. I haven't written any code for this project
When I ran this project I got the usual welcome screen and I added the Test-portlet to the page and removed other stuff from the page.
I actually want to create a website using liferay. The website already exists which should be rewritten in liferay.
So when I load the project I get this welcome screen and the Test-portlet. At the top of this page I get the the menu-Admin,Sites,.... and LIferay logo on LHS.
I wish to remove all of these and displa only the web page data of the website. I know I can use themes and layouts for such purpose.
If I should use portlet to create this website , how should I keep adding pages and designs?
Also how should I add pages,themes,templates to this portlet?
Before creating this Test-portlet project, I had created pages using control panel.
How should I create this website? Using portlet by creating project?
EDIT:
Also this Test-portlet is displayed as a small portlet on the entire page. WHen click on the gear symbol and click on maximise, it only maximises during that time and when project is run again, it comes back to its original size.
Should I create this websiste using portlets?
Data for website comes from database. Few pages have static data.
Subsequent pages may be added in future.
HOw should the pages be added if I use portlet to create the website?
Please go through liferay themes and liferay layouts

Liferay portlet for creating web content

I use Liferay to manage web content. I would like my end users to create web content but I don't want them to go to back office to manage it.
So I would like a portlet that I can setup in public pages and which allows the end users to create web content directly in public pages.
Is there a simple way to do it using Liferay 6.1 or code is needed ?
Have you tried OOTB Web Content Display portlet? You can add Web Content Display portlet on any page and content can be created in that portlet itself which on publishing(if no workflow involved) will be visible on the page.
If Sandeep's answer is not what you're after (but I suspect it is) then you can write a custom portlet that uses Liferay's JournalArticleLocalServiceUtil methods to interact with Liferay Web Content. However I'd go with Sandeep's suggestion first as it doesn't involve coding! :)
If you want to develope another webcontent portlet as avaiable in control panel. You have to go for custom portlet creation and use the db tables like JournalArticle, JournalArticleImage, JournalArticleStructure and JournalArticleTemplate.

Resources