With reference to the following link, https://www.liferay.com/community/wiki/-/wiki/Main/Custom+Fields+and+JSP+Hooks I am able to add the custom fields. But by default the newly added custom fields are showing under the "Custom Fields" tab. But I need to display my custom fields under the "Details" tab. How can I do that. Any suggestions please!!
You would have to hook the JSP of the portlet that you are working on. For example if you are working on Journal article portlet, than you will have to hook the JSPs in TOMCAT/.../html/portlet/journal/article/...jsp and make the changes in these JSPs as per your need.
Hope it help
Related
I have added one custom attribute in SimpleCMSComponent which I am able to see in backoffice but not in CMS cockpit.
Is there any file do I need to update to show this field in CMSCockpit ?
to be more precise I am trying to show this field in BannerComponent's Admin or Basic tab.
Thanks
Changes need to be added in EditorArea_BannerComponent.xml and then system update is required by selecting OOTB cockpits and custom cockpit extensions.
I want to add a paging control on my custom web-part so I can customize the paging style. I am using a CMSRepeater for binding the data. Thanks
If you are using CMSRepeater you can try to add UniPager to it. This control is easy customizable. Please see this link: https://docs.kentico.com/k9/references/kentico-controls/generic-controls/paging-controls/unipager
You don't need to create a custom webpart to setup different styling for paging. Simply add a repeater to a page template and add the Universal Pager webpart to the page. In the Universal Pager webpart set the Web part control ID in the target control name from the repeater you want to hook it up to. Then in the Universal Pager webpart define your transformations. Again, no need for a custom webpart for this, just use 2 already created webparts together.
I have a requirement in liferay portal to allow user to add some specific portlets on a particular page. Same can be done in 2 ways:
This will require some custom code to be plugged in add panel code
create a custom portlet which will be present on left hand
side of page and allows portlet to be added and dragged on page.
On add of portlet it checks if the page can have this portlet and accordingly remove it
The question I have is which of these 2 approaches shall be used, and how?
Note: I was unable to find much about this on google as well
I believe Liferay permission system is strong enough to express what you need.
The portlet list shown in "Add more portlets" menu can be customized through a Regular Role. See How to customize which portlets to show in “Add more portlets” menu for detailed info.
To restrict the options for a single page (or several pages), modify its permissions, so that only the new Regular Role is be able to update it.
Based on your comment to Tomáš Piňos's answer, my suggestion would be to create a custom portlet that uses Liferay's API and enables you to do just this: On the page where it's available, use it to enable/disable the portlets you'd like to be there by use of Liferay's API. You'll find quite a lot of sample when you're looking for the old sevencogs example (that sadly does not compile any more, but in general the API has only changed marginally). The most up to date resources with further links to the ancient code are these 2 blog articles.
About your third option (as you ask in the comments): Yes, it's possible: You can override Liferay's Services as well as react to model changes. This means that you could add your own check on updates. However, I'd feel it inappropriate to offer the option to add any portlet only to prohibit it whenever a user indeed uses the offered option. That's why I didn't include this option in my initial answer.
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
I can easily add webparts to my custom master page, but they appear static (in page edit mode)...Is there a way i can add custom webparts in master page with user editing its properties (through property bag)
Have you tried adding the WebBrowsable attribute to your WebPart? See http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webbrowsableattribute.aspx
[Personalizable(), WebBrowsable(), WebDisplayName("My WebPart"), WebDescription("This is my editable WebPart")]
Sadly In master page, visual web-part is not editable as they dont exist in web part zone, so now we use user control as delegate control.