[opencms-dev] How to modify title on opencms jsp formatter?
Kai Widmann
Widmann at mediaworx.com
Fri Mar 28 13:01:43 CET 2014
Hi Javi,
this is not an easy task to do in JSP/Java, since the title and the meta tags are usually rendered by the template before the formatter is executed. I don't see a way that can be achieved easily without the use of JavaScript.
I'm not so much into JavaScript that I can tell you exactly what to do, but I know that this is possible.
So if using JavaScript is an option for you, there are many ways to go. Some examples:
* The easiest way would be to include some JavaScript in the formatter (executed during load) that modifies the title and meta tags.
* Another option is to set some hidden fields with your variables (hidden form fields or hidden divs) in the formatter and have an onLoad function (added to the body) that reads those variables and does the title/meta modification.
If you're looking for a plain JSP/Java solution you'll have to be creative. This surely can be done somehow, but I can't think of any easy way.
Hope that helps
Kai
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Javi Finarfin
Gesendet: Mittwoch, 26. März 2014 18:13
An: opencms-dev at opencms.org
Betreff: Re: [opencms-dev] How to modify title on opencms jsp formatter?
Hi!,
First time here. I´m using opencms 8.5.4. I have a opencms formatter (a jsp file) where I calculate some variables there that I want to use to modify the meta tags description and the title. What´s the best way to do this?
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20140328/818b2a45/attachment.htm>
More information about the opencms-dev
mailing list