- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 04:03 AM
Hi,
I have created a UI macro which is like a news bulletin scrollable widget.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_inc">
var inc = new GlideRecord('cmdb_ci_outage');
inc.query();
</g2:evaluate>
<div style="background-color:DDDDDD; padding-left:10px; line-height:19px; border:2px white solid" width="100%" nowrap="true">
<input id="make_spacing_ok" style="visibility:hidden;width:0px:" title=""/>
</div>
<g2:scrollable_area height="100px" width="50%">
<j2:while test="$[inc.next()]">
<j2:set var="jvar_inc_link" value="cmdb_ci_outage.do?sys_id=$[inc.sys_id]"/>
<j2:set var="jvar_inc_list_link" value="cmdb_ci_outage_list.do?"/>
<span style="line-height: 10px; padding-left:10px">
<a href="$[jvar_inc_link]">
<IMG SRC="images/services.png" style="padding-right:10px"></IMG>
</a>
<a href="$[jvar_inc_link]" style="padding-right:10px; color:blue">$[inc.cmdb_ci.name]</a>
is undergoing $[inc.type] and will be unavailable from $[inc.begin] to $[inc.end]
</span>
<br style="line-height:5px"/>
</j2:while>
<span>
<a href="$[jvar_inc_list_link]" style="color:blue; padding-left:10px">View all outages</a>
</span>
</g2:scrollable_area>
</j:jelly>
I am trying to call this macro inside my content block below the 'Announcement' div. I tried like this: <g:macro_invoke macro="decorate_welcome_header_stripe_left" /> but it didnt worked
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<body link = "white">
<!-- <div style="margin-left: 59px; background-image: url('Headerbackground.jpg'); background-repeat: no-repeat; font-family: Archer; font-size: 30px; color: white; width: 90%; height: 90px;"> -->
<div style="margin-left: 24px;">
<img src="Headerbackground.jpg" width="747" height="90"/>
<div style="position:absolute; top:32px; left:504px; height:25px;">
<div style="margin-left: 401px; margin-top:-17px;">
</div>
<center><font size="+3" color="white" style="font-size:45px; margin-bottom:-24px; margin-left: 298px; margin-top: 157px; float: left;">Service Portal</font></center>
</div>
</div>
<!--<div style="float: left; margin-left: 425px; margin-top: 15px; font-size: 48px;"> Service Portal </div> </div>-->
<div style = "margin-left: 5px; float: left;">
<div style="background-color:#8cd0f3; height:250px;width:232px;margin-left: 20px; margin-top: 20px;">
<div style="float: left;margin-left: 10px;margin-top: 10px;height:50px;width:50px; background-image: url('order.jpg'); background-repeat: no-repeat;"></div>
<div style="color: white;float: right;font-size: 40px; margin-right: 10px; font-family: Archer; font-size: 30px;"><a href="https://dev23744.service-now.com/ess/order_things.do" style="color:white">Order</a></div>
<div style="color: white;float: right; height: 20px;width: 155px; font-family: Arial; font-size: 18px;"> Order Equipment and services</div>
<div style="color: white;float: left;margin-top: 60px;margin-left: 5px;width: 100px; font-family: Arial; font-size: 12px;"> <a href="https://dev23744.service-now.com/sc_cat_item_list.do?sysparm_query=type!%3Dbundle%5Esys_class_name!%..." style="color:white">Computer/Hardware</a> <a href="https://dev23744.service-now.com/sc_cat_item_list.do?sysparm_query=type!%3Dbundle%5Esys_class_name!%..." style="color:white"> Mobile Devices </a> <a href="https://dev23744.service-now.com/sc_cat_item_list.do?sysparm_query=type!%3Dbundle%5Esys_class_name!%..." style="color:white">Software </a> </div>
</div>
<div style="float: left;margin-left: 25px;margin-top: 30px;height:50px;width:50px; background-image: url('howdoI.jpg'); background-repeat: no-repeat;"></div>
<div style="background-color:#00aee3; height:250px;width:232px; margin-left: 20px; color: white; font-family: Archer; font-size: 24px; margin-top: 20px;">
<div style="color: white;float: right;font-size: 40px; margin-right: 10px; font-family: Archer; font-size: 30px;"><a href="https://dev10167.service-now.com/ess/knowledge_splash.do" style="color:white">How do I</a></div>
<div style="color: white;float: right; height: 20px;width: 155px; font-family: Arial; font-size: 18px; margin-right: -55px;"> Get help</div>
<div style="color: white;float: left;margin-top: 60px;margin-left: 5px;width: 205px; font-family: Arial; font-size: 12px;"><a href = "https://dev23744.service-now.com/kb_view.do?sys_kb_id=77793405db331200a87c58eebf961988" style="color:white">Contact us</a><br> <a href="https://dev23744.service-now.com/kb_view.do?sys_kb_id=84fa7405db331200a87c58eebf96199c" style="color:white">How do I log an incident</a> <br><a href="https://dev23744.service-now.com/kb_view.do?sys_kb_id=f8bbf405db331200a87c58eebf9619cd" style="color:white">Access service desk procedures</a><br> <a href="https://dev23744.service-now.com/kb_view.do?sys_kb_id=464c7c05db331200a87c58eebf9619f3" style="color:white"> Using Office 365</a></br></br></br></div>
</div>
</div>
<div style = "margin-left: 5px; float: left;">
<div style="float: left;margin-left: 25px;margin-top: 30px;height:50px;width:50px; background-image: url('Assess.jpg'); background-repeat: no-repeat;"></div>
<div style="background-color:#007ebd; height:250px;width:232px; margin-left: 20px; color: white; font-family: Archer; font-size: 24px; margin-top: 20px;">
<div style="color: white;float: right;font-size: 40px; margin-right: 10px; font-family: Archer; font-size: 30px;">Access</div>
<div style="color: white;float: right; height: 20px;width: 155px; font-family: Arial; font-size: 18px; margin-right: -26px;"> Manage and request access</div>
<div style="color: white;float: left;margin-top: 60px;margin-left: 5px;width: 100px; font-family: Arial; font-size: 12px;">Reset password Application access Group email Shared drive</div>
</div>
<div style="float: left;margin-left: 25px;margin-top: 30px;height:50px;width:50px; background-image: url('Support.jpg'); background-repeat: no-repeat;"></div>
<div style="background-color:#005394; height:250px;width:232px; margin-left: 20px;color: white; font-family: Archer; font-size: 24px; margin-top: 20px; margin-top: 20px;">
<div style="color: white;float: right;font-size: 40px; margin-right: 10px; font-family: Archer; font-size: 30px; margin-top: -2px;">Support</div>
<div style="color: white;float: right; height: 20px;width: 155px; font-family: Arial; font-size: 18px;"> Raise an incident</div>
<div style="color: white;float: left;margin-top: 60px;margin-left: 5px;width: 100px; font-family: Arial; font-size: 12px; margin-right: -60px;"> <a href="https://dev23744.service-now.com/ess/create_incident.do" style="color:white">Log an incident</a> <a href="https://dev10167.service-now.com/ess/home.do" style="color:white">Service desk tools</a> <a href="https://dev23744.service-now.com/ess/incident_status.do" style="color:white">Get help status</a> </div>
</div>
</div>
<div style = "margin-left: 5px; float: left;">
<div style="background-color:#00aee3; height:250px;width:232px; color: white; margin-left: 20px; font-family: Archer; font-size: 24px; margin-top: 20px;">
<div style="color: white;float: right; height: 20px;width: 155px; font-family: Archer; font-size: 30px; margin-right: 50px;"><a href="https://dev23744.service-now.com/cmdb_ci_outage_list.do" style="color:white"> Announcements </a>
<g:macro_invoke macro="decorate_welcome_header_stripe_left" />
</div>
</div>
<div style="background-color:#646466; height:50px;width:232px; margin-left: 20px;color: white; font-family: Archer; font-size: 20px; margin-top: 20px;">
<div style="color: white;float: right;font-size: 20px; margin-right: 81px; font-family: Archer; margin-top: 10px;"> <a href="https://dev10167.service-now.com/ess/incident_status.do" style="color:white">My Orders</a> </div>
</div>
<div style="background-color:#646466; height:50px;width:232px; margin-left: 20px;color: white; font-family: Archer; font-size: 20px; margin-top: 17px;">
<div style="color: white;float: right;font-size: 20px; margin-right: 48px; font-family: Archer; margin-top: 10px;">My access requests</div>
</div>
<div style="background-color:#646466; height:50px;width:232px; margin-left: 20px;color: white; font-family: Archer; font-size: 20px; margin-top: 17px;">
<div style="color: white;float: right;font-size: 20px; margin-right: 65px; font-family: Archer; margin-top: 10px;"> <a href="https://dev23744.service-now.com/ess/incident_list.do?sysparm_query=active%3Dtrue%5Ecaller_id%3Djava...()" style="color:white">My incidents</a></div>
</div>
<div style="background-color:#c8c9cb; height:50px;width:108px; margin-left: 20px; font-family: Archer; font-size: 20px; margin-top: 17px;">
<div style="color: white;float: right;font-size: 17px; margin-right: 6px; font-family: Archer; margin-top: 10px;">My approvals</div>
</div>
<div style="background-color:#c8c9cb; height:50px;width:108px; margin-left: 20px;float: right; margin-top: -50px; font-family: Archer; font-size: 20px;">
<div style="color: white;float: right;font-size: 17px; margin-right: 14px; font-family: Archer; margin-top: 10px;">My queues</div>
</div>
</div>
</body>
</j:jelly>
Any help will be appreciated. Thanks in advance!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 06:30 AM
Hi Kunal,
You've called the macro correctly in your dynamic block, but I noticed that your macro has a good amount of phase 2 jelly in it. By default dynamic content blocks don't render phase 2 jelly, so you have to make sure that the Two phase field is set to true on the dynamic content record. It may actually be calling the macro but since the content isn't being rendered it looks like it's not there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 04:24 AM
Hi,
macro_invoke tag
The macro_invoke tag calls a UI macro that you have specified in the database. You may also call a UI macro by specifying it in the tag name. For example, if you had a UI macro named my_macro, you could call that macro with the tag <g:my_macro/>.
Parameters:
macro - The name of the UI macro to execute. If your tag name is g:macro_invoke, then the macro attribute specifies the name of the macro. If the tag name includes the name of the macro, then there is no need to include a macro attribute.
Other attributes - For each attribute you specify, a variable with that name will be available in the context of the UI macro, prefixed with "jvar_".
<!-- Will invoke the contents of the UI macro named "sample_macro", which will have the variable jvar_message available within it-->
<g:macro_invoke macro="sample_macro" message="This is a sample macro variable." />
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 06:30 AM
Hi Kunal,
You've called the macro correctly in your dynamic block, but I noticed that your macro has a good amount of phase 2 jelly in it. By default dynamic content blocks don't render phase 2 jelly, so you have to make sure that the Two phase field is set to true on the dynamic content record. It may actually be calling the macro but since the content isn't being rendered it looks like it's not there.
