Style sheet & Ui page why my link not working ?

srevinU
Kilo Contributor

Hello guys,

I'm working on a popUp window, this one is working then I would to style it with some CSS. So I decided to use Style sheet to call the sheet form the ui page via <link> in my jelly. But unfortunately it's doesn't work, I get the sys_id of my style sheet but once I use it in the href it doesn't seem to work.

There is my jelly script from my ui page:

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

	<g:evaluate>
		var css = new GlideRecord("content_css");
		css.addQuery("name", "pop_up_style");
		css.query()
		css.next();
		var cssid = ""+css.sys_id;
	</g:evaluate>

	<link href="${cssid}.cssdbx?" rel="stylesheet" type="css"/>

	<p>
		${cssid}
		${cssid}.cssdbx?
	</p>

	<g:ui_form>

		<p style="padding:2%;">
			Hello
		</p>

		<button type= "submit" class="confirm_input" ng-click="">Ok</button>

		<button type= "submit" class="cancel_input" ng-click="">Cancel</button>


	</g:ui_form>


</j:jelly>

 And there is my style sheet (I checked the scope and I'm in the right one):

find_real_file.pngThank you for your help !

1 REPLY 1

Brent Moberly
Tera Contributor

I'm coming really late to this thread, but I was able to get your code working this way:

<g:evaluate>
	var gr = new GlideRecord("content_css");
	gr.addQuery("name", "[name of css]");
	gr.query()
	gr.next();
	var css_id = gr.getValue('sys_id');
</g:evaluate>

<link href="${css_id}.cssdbx?" rel="stylesheet" type="text/css"/>

Here, the type attribute in the link tag needs to be "text/css" not just "css." If it was just "css" the stylesheet would not load.

I hope this is somewhat helpful after all this time.