Liferay becomes modular and it requires more efforts to extend it's functionality. I believe that is for our own good but yeah it becomes complex.
To override a javascript file now requires a bundle with some specific entries.
In this example I am overriding logo editor of Liferay and adding a console log to demonstrate the same.
To override a javascript file now requires a bundle with some specific entries.
In this example I am overriding logo editor of Liferay and adding a console log to demonstrate the same.
- BND
- CONFIG.JS
- FILE_TO_OVERRIDE
1.BND
Liferay-JS-Config takes the config file which does the magic to override. Even though this file is useful for multiple occasions, for now we will use it for this purpose only.
Web context path for web resources, in our case it's java script.
Web context path for web resources, in our case it's java script.
Bundle-Name: logo-editor-for-snapBundle-SymbolicName: logo-editor-for-snapBundle-Version: 1.0.0Liferay-JS-Config: /META-INF/resources/js/config.jsWeb-ContextPath: /logo-editor-web-override
2.CONFIG.JS
- base: File location to override
- path: File Name
- condition: In which scenario this module should be loaded
- name: Name of the module
- trigger: Should trigger when a call made to module, e.g. liferay-logo-editor
- when: This module replace triggered module with value instead. There are multiple values possible for this, subject to explore.
;(function() {
AUI().applyConfig({groups: {sessionext: {base: MODULE_PATH + '/js/',combine: Liferay.AUI.getCombine(),filter: Liferay.AUI.getFilterConfig(),modules: {'liferay-logo-editor-override': {path: 'liferay-logo_editor.js',condition: {name: 'liferay-logo-editor-override',trigger: 'liferay-logo-editor',when: 'instead'}}},root: MODULE_PATH + '/js/'}}});})();
3. FILE TO OVERRIDE [e.g. logo_editor.js renamed to liferay-logo_editor.js]
Change the module name at first line.
AUI.add( 'liferay-logo-editor-override', function(A) { var Lang = A.Lang;............renderUI: function() { var instance = this; console.log("LOGO EDITOR OVERRIDDEN...");........
I took the reference from this post and explained as much I can.
Thanks to Liferay Staff members for the snippets!
You are just done, Try & Enjoy the function.............:)
It's A Nice Post.
ReplyDeleteBest Java Training in Bangalore
Best Oracle Training in Bangalore
Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info!
ReplyDeleteFront end development course in chennai
Thanks for giving a great information about override-javascript Good Explination nice Article
ReplyDeleteanyone want to learn advance devops tools or devops online training
DevOps Online Training DevOps Online Training hyderabadcontact Us: 9704455959
This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to article very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
ReplyDeleteDedicatedHosting4u.com
Surpassing Article, This post contains great information about this topic. Can you please do a more extra post like from this blog and Thank you much more for sharing this useful info.
ReplyDeletePrimavera Training in Chennai
Primavera Software Training in Chennai
Advanced Excel Training in Chennai
Oracle DBA Training in Chennai
Embedded System Course Chennai
Unix Training in Chennai
Linux Training in Chennai
Pega Training in Chennai
Tableau Training in Chennai
Primavera Training in Thiruvanmiyur
Primavera Training in Vadapalani
I’d should talk to you here. Which is not some thing I do! I quite like reading a post which will make people believe. Also, many thanks permitting me to comment! webflow agency
ReplyDeleteHey There. I found your blog using msn. This is an extremely well written article. I’ll be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback. webflow development agency
ReplyDeleteAnd Im running from a standard users account with strict limitations, which I think may be the limiting factor, but Im running the cmd as the system I am currently working on. ui/ux design
ReplyDeleteThis content is written very well. Your use of formatting when making your points makes your observations very clear and easy to understand. Thank you. best brand agencies
ReplyDeleteCheers for this excellent. I was wondering whether you were planning of publishing similar posts to this. .Keep up the excellent articles! top front end developers
ReplyDeleteEnjoyed reading this, very good stuff, thankyou . website designer nyc
ReplyDeleteI had been honored to receive a call coming from a friend as he observed the important points shared in your site. Looking at your blog publication is a real great experience. Thank you for thinking of readers like me, and I desire for you the best of achievements for a professional surface area. resorts in cuba new york web design company
ReplyDeleteThere is noticeably a lot to realize about this. I suppose you made certain nice points in features also. san francisco brand agency
ReplyDeleteOutstanding post, I think blog owners should larn a lot from this blog its really user genial . branding sf
ReplyDelete
ReplyDeleteThank you for sharing such a great information.Its really nice and informative.hope more posts from you. I also want to share some information recently i have gone through and i had find the one of the best
DevOps Training in Chennai | DevOps Training in anna nagar | DevOps Training in omr | DevOps Training in porur | DevOps Training in tambaram | DevOps Training in velachery
Your post is very good. I got to learn a lot from your post. Thank you for sharing your article for us. it is amazing post
ReplyDeleteweb designing training in chennai
web designing training in omr
digital marketing training in chennai
digital marketing training in omr
rpa training in chennai
rpa training in omr
tally training in chennai
tally training in omr
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging.
ReplyDeleteweb designing training in chennai
web designing training in tambaram
digital marketing training in chennai
digital marketing training in tambaram
rpa training in chennai
rpa training in tambaram
tally training in chennai
tally training in tambaram
I learned something new from your blog. Amazing stuff. I would like to follow your blog frequently. Keep Rocking!!
ReplyDeletejava training in chennai
java training in annanagar
aws training in chennai
aws training in annanagar
python training in chennai
python training in annanagar
selenium training in chennai
selenium training in annanagar
Successful visual communication is seen as reasonable, fitting, and valuable.Professional graphic design
ReplyDeleteI found your blog so interesting to read. good article.
ReplyDeleteselenium framework architecture
importance of angularjs
importance of aws certification
android 8.0 update
android 8.0
aws interview questions and answers for freshers
I pay a visit every day a few blogs and sites to read articles, but this weblog offers feature based writing.
ReplyDeleteleather sofa set
I read this article fully on the topic of the resemblance of most recent and preceding technologies, it’s remarkable article.
ReplyDeleteStudy in Ireland Consultants
Amazing content !
ReplyDeleteGerman Education Consultants in India
These are truly fantastic ideas regarding blogging. You have touched on some pleasant points here. Any way keep up writing.
ReplyDeleteBada Business
Admiring the dedication you put into your blog and in depth information you provide. It’s awesome to come across a blog every once in a while that isn’t the same old rehashed information. Fantastic read! Software Security Solutions
ReplyDeleteToday the web development companies have matured into esteemed and dedicated quality service providers, offering website solutions that enhance the prospects of the small and medium sized businesses to prosper online Website Developers
ReplyDeleteInternet users tend to prefer easy to use websites, because they do not want to have to learn how to use a website every time they find a new one. They should be able to use a website after only a few seconds of looking around a homepage, any more and they will leave and browse elsewhere. web design dubai
ReplyDelete