I am using hippo cms 7.9.3
I want to add a css file in my head from a content jsp.
I tried
<hst:headContribution category="css">
<link href="<hst:link path="css/cssfile.css" />" type="text/css" rel="stylesheet" />
</hst:headContribution>
This did worked in test.jsp, The css file is added in the head at a postion.
In webpage.jsp it did not worked, see code below:
<%@ include file="/WEB-INF/jspf/htmlTags.jspf" %>
<html lang="en">
<head>
<meta charset="utf-8">
<hst:link var="favicon" path="/images/favicon.ico" />
<link rel="icon" href="${favicon}">
</head>
<body>
<hst:headContribution category="css">
<link href="<hst:link path="css/cssfile.css" />" type="text/css" rel="stylesheet" />
</hst:headContribution>
<div id="main">
<hst:include ref="header" />
<hst:include ref="main" />
<hst:headContributions categoryIncludes="scripts" xhtml="true" />
<hst:include ref="footer" />
</div>
</body>
</html>
What I want to achieve
I want the [green] code in my my webpage.jsp and that it will work.
Business logic.
I want to add a css file only for one page, so I use <hst:headContribution category="css">. But this css file needs to be below a another certain css file else it will overrule it the css.
Any ideas/suggestion how the [green] code will work in my webpage.jsp?
Thanks in advance.
Regards,
Arsdeep
Hi Woonsan,
Thanks for the very quick response.
Normally I would add the css code below, but now I want to have my css file at the very top level, the first css file of the generated html.
The cssfile.css is actually the root css and need to be above all other css files.
Code <link href="<hst:link path="css/cssfile.css" />" type="text/css" rel="stylesheet" />
It did not the trick for me what I wanted to achieve.
Actions I have executed in webpage.jsp
I put the code before the <head>:
<html lang="en">
<hst:headContribution category="css">
<link href="<hst:link path="css/cssfile.css"
/>" type="text/css" rel="stylesheet"
/>
</hst:headContribution>
<head>………………………………………
Actions i executed in test.jsp (other jsp) uses template webpage.jsp
<hst:headContribution category="css">
<link href="<hst:link path="css/test.css"
/>" type="text/css" rel="stylesheet"
/>
</hst:headContribution>
Generated html (problem)
<link rel="stylesheet" type="text/css" href="/css/test.css"/> (this file was added in test.jsp)
<link rel="stylesheet" type="text/css" href="/css/cssfile.css"/> (this file was added in webpage.jsp) This one need to be first.
Any ideas suggestions how I can achieve my goal?
Regards,
Arsdeep
> <mailto:hippo-community+unsub...@googlegroups.com>.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
> <mailto:hippo-community+unsubscr...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.
--
w....@onehippo.com www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.