Dynamic value in <head>

asked 2022-02-01 19:57:23 +0800

MartVq gravatar image MartVq
37 2

Hello, i am wondering if there is a way to pass values (like using el expressions for example) to element inside <head>?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-02-02 17:05:44 +0800

MDuchemin gravatar image MDuchemin
2228 1 5
ZK Team

From zul, you can use a header processing instruction: https://www.zkoss.org/wiki/ZUMLReference/ZUML/ProcessingInstructions

You can use these to generate usual <head> elements such as scripts, style, meta tags.

If you need to have finer control over the element, you can use the PageCtrl (cast page as PageCtrl to access this interface) and use addAfterheadTags: https://www.zkoss.org/javadoc/8.0.0/zk/org/zkoss/zk/ui/sys/PageCtrl.html#addAfterHeadTags(java.lang.String)) This lets you generate arbitrary HTML content after the default ZK head elements.

Most use cases don't need to go that specific though. If you need meta, script or style tags, processing instructions will do just fine, and support EL expressions.

link publish delete flag offensive edit


Good stuff, many thanks!

MartVq ( 2022-02-02 21:40:38 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2022-02-01 19:57:23 +0800

Seen: 7 times

Last updated: Feb 02

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More