Zsolt Balogh 14 Years Ago Nice article, thanks!Your example is not set to be layout-cacheable, so it will really drop performance, if you are using it on every page. Or the layout.static.portlets.all included portlets are always layout cacheable? Please sign in to reply. Reply as... Cancel
Jonas Yuan 14 Years Ago Nice article. Thank you, Samuel!. Please sign in to reply. Reply as... Cancel
Milen Dyankov 14 Years Ago Samuel, thanks for sharing this really useful information. The technique you describe was used in "Custom Global Markup Portlet" which allows to add markups (javascript, css, html) to every page in given community by providing convenient management interface in Liferay’s control panel. Please sign in to reply. Reply as... Cancel
Blaine Boule 13 Years Ago This is a great idea, but I have one question. I have implemented this in our environment, to enable WebTrends internally. It is nice to be able to configure this as a portlet and have it show on every page, but I dont want the user to actually see the portlet. Is it possible to attain this functionality without actually showing the portlet to the user? Essentially the portlet is empty except for the script block, so we would want the portlet to be invisible to the user.Blaine Please sign in to reply. Reply as... Cancel Samuel Kong Blaine Boule 13 Years Ago Blaine, make sure you do step 6. Please sign in to reply. Reply as... Cancel Blaine Boule Samuel Kong 13 Years Ago Thanks for the suggestion, but I did make sure I added that step. I was unaware of the "system" tag at first, but once I added that and made it true, all it did was remove it from the "Add Application" Menu. Meanwhile the portlet was added to every page, via the portal-ext.properties - not a hook, and is visible to users. Side note, this is being deployed to 5.2.3Blaine Please sign in to reply. Reply as... Cancel Samuel Kong Blaine Boule 13 Years Ago You need to add <use-default-template>false</use-default-template> to liferay-portlet.xml. Sorry for the confusion.I've also updated the blog with the change. Please sign in to reply. Reply as... Cancel Blaine Boule Samuel Kong 13 Years Ago Ahhh, thank you for the clarification!Blaine Please sign in to reply. Reply as... Cancel
Samuel Kong Blaine Boule 13 Years Ago Blaine, make sure you do step 6. Please sign in to reply. Reply as... Cancel Blaine Boule Samuel Kong 13 Years Ago Thanks for the suggestion, but I did make sure I added that step. I was unaware of the "system" tag at first, but once I added that and made it true, all it did was remove it from the "Add Application" Menu. Meanwhile the portlet was added to every page, via the portal-ext.properties - not a hook, and is visible to users. Side note, this is being deployed to 5.2.3Blaine Please sign in to reply. Reply as... Cancel Samuel Kong Blaine Boule 13 Years Ago You need to add <use-default-template>false</use-default-template> to liferay-portlet.xml. Sorry for the confusion.I've also updated the blog with the change. Please sign in to reply. Reply as... Cancel Blaine Boule Samuel Kong 13 Years Ago Ahhh, thank you for the clarification!Blaine Please sign in to reply. Reply as... Cancel
Blaine Boule Samuel Kong 13 Years Ago Thanks for the suggestion, but I did make sure I added that step. I was unaware of the "system" tag at first, but once I added that and made it true, all it did was remove it from the "Add Application" Menu. Meanwhile the portlet was added to every page, via the portal-ext.properties - not a hook, and is visible to users. Side note, this is being deployed to 5.2.3Blaine Please sign in to reply. Reply as... Cancel Samuel Kong Blaine Boule 13 Years Ago You need to add <use-default-template>false</use-default-template> to liferay-portlet.xml. Sorry for the confusion.I've also updated the blog with the change. Please sign in to reply. Reply as... Cancel Blaine Boule Samuel Kong 13 Years Ago Ahhh, thank you for the clarification!Blaine Please sign in to reply. Reply as... Cancel
Samuel Kong Blaine Boule 13 Years Ago You need to add <use-default-template>false</use-default-template> to liferay-portlet.xml. Sorry for the confusion.I've also updated the blog with the change. Please sign in to reply. Reply as... Cancel Blaine Boule Samuel Kong 13 Years Ago Ahhh, thank you for the clarification!Blaine Please sign in to reply. Reply as... Cancel
Blaine Boule Samuel Kong 13 Years Ago Ahhh, thank you for the clarification!Blaine Please sign in to reply. Reply as... Cancel
Stephen Theriault 13 Years Ago is there a way to it have it run just on the main page or on one page instead of every page Please sign in to reply. Reply as... Cancel Blaine Boule Stephen Theriault 13 Years Ago Stephen - when we needed to do that (on a single page) we went into Manage Pages, selecting the page you wanted. Under the Page tab, at the bottom you see a "JavaScript" area you can click on, select that and you will get 3 input areas where you can place JavaScript code. That will load every time for that page. I don't know if this is the best practice method, but it is what we have used for this situation.Blaine Please sign in to reply. Reply as... Cancel
Blaine Boule Stephen Theriault 13 Years Ago Stephen - when we needed to do that (on a single page) we went into Manage Pages, selecting the page you wanted. Under the Page tab, at the bottom you see a "JavaScript" area you can click on, select that and you will get 3 input areas where you can place JavaScript code. That will load every time for that page. I don't know if this is the best practice method, but it is what we have used for this situation.Blaine Please sign in to reply. Reply as... Cancel
(You) 12 Years Ago [...] Hi, I'm using Liferay EE version 6.1.10. I've been searching for a way to add my own custom Javascript (also include for external JS files) to every page in the portal. I want to have a way to add JS... [...] Read More Please sign in to reply. Reply as... Cancel
Alexey Bykov 9 Years Ago Thank you, Samuel Kong! This article helped me. Please sign in to reply. Reply as... Cancel