- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2016 08:44 AM
Hi,
I'm working on a dynamic content block and im struggling on preserving the white space.
I want to maintain the white space between the apostrophes: news += (' ')
Any suggestions?
Script:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<j2:whitespace trim="false">
<span style="color:red">
<g:evaluate>
var news = '' ;
var kb = new GlideRecord('kb_knowledge');
var now = gs.dateGenerate(gs.yesterday(), 'end');
kb.addQuery('valid_to', '>', now);
kb.addQuery('topic','News');
kb.addQuery('category', 'NewsFlash');
kb.addQuery('workflow_state','published');
kb.query();
while (kb.next()){
(news == '') ? news = kb.short_description.toString() : news += (' ') + kb.short_description.toString();
}
</g:evaluate>
<j:while test="${kb.next()}">
<j:if test="${kb.canRead()}">
<g:evaluate>
news += kb.short_description + (' ');
</g:evaluate>
</j:if>
</j:while>
<marquee behavior="scroll" direction="left"><b>${news} </b></marquee>
</span>
</j2:whitespace>
</j:jelly>
Thanks,
Adam
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2016 09:13 AM
I always have a good bit of trouble with jelly stripping out white spacing event when using ${SP}. What I usually do is use a div with a margin to add the space. So something like:
<marquee behavior="scroll" direction="left"><div style="font-weight:bold;margin-right:10px">${news}</div></marquee>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2016 09:15 AM
'& n b s p; ' worked fine for me...without spaces in between and without quotes. Replying to this is a big pain as each time its replacing it with a space
Infact if you reply to this comment with writing that without quotes it prints a blank only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2016 06:56 AM
I was wondering would It be possible to have a link in the marquee which directs the user to the record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2016 08:55 AM
should work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2016 10:33 AM
im having no luck with the clicking on the display results within the marquee and directing the user to contents of the record
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 02:08 AM
hyperlink in a marquee is no biggie, im sure you are stuck somewhere else. Can you show you code and describe what you are trying to achieve?