We used to have RefinedWiki theme installed until recently. I'm pretty sure that theme displayed the space name for each update listed on the Dashboard.
Is there any way I can add the space to update items in the default Confluence theme?
If so, can someone please point me to the file I need to customise? I've looked at this document here which gives me the clue that it may be possible... https://confluence.atlassian.com/display/CONF42/Customising+the+Dashboard#CustomisingtheDashboard-Modifyingtheglobaltemplateorlayout
It seems like this is fully generated by the recently-updated-dashboard macro, and the HTML is rendered by some javascript that doesn't appear to be template driven (at least not using those .vm templates anyway). I managed to override the function that renders each update item and force it to refresh the list on page load to bring in the space name by adding this script with the altered function to our Custom HTML...
AJS.toInit(function(){ // Override update item template to include Space Name Confluence.Templates.Dashboard.Updates.updateItem_old = Confluence.Templates.Dashboard.Updates.updateItem; Confluence.Templates.Dashboard.Updates.updateItem = function(opt_data, opt_sb) { try { var output = opt_sb || new soy.StringBuilder(); output.append('<li class="update-item"><div class="update-item-icons">', (opt_data.changeItem.thumbnailable) ? '<a id="twixie-' + soy.$$escapeHtml(opt_data.changeSetNumber) + soy.$$escapeHtml(opt_data.changeItemNumber) + '" href="" data-thumbnail-id="' + soy.$$escapeHtml(opt_data.changeSetNumber) + soy.$$escapeHtml(opt_data.changeItemNumber) + '" class="update-item-arrow icon icon-section-closed"></a>' : '<span class="update-item-arrow"></span>'); Confluence.Templates.Icons.contentIcon({content: opt_data.changeItem.entity, iconTitle: opt_data.changeItem.friendlyContentType, iconCss: opt_data.changeItem.iconCss, linkHref: opt_data.changeItem.urlPath}, output); output.append('</div><div class="update-item-content"><span class="update-item-title">', opt_data.changeItem.html, '</span>'); if (opt_data.changeItem.spaceName != undefined) output.append('&nbsp;<span class="smalltext">(', soy.$$escapeHtml(opt_data.changeItem.spaceName), ')</span>'); output.append('<span class="update-item-date"> ', soy.$$escapeHtml(opt_data.changeItem.updateDescription), '</span>', (opt_data.changeItem.viewChangesLink) ? '<span class="update-item-changes">(<a href="' + soy.$$escapeHtml(opt_data.changeItem.viewChangesLink) + '">' + soy.$$escapeHtml("view change") + '</a>)</span>' : '', (opt_data.changeItem.summary) ? '<p class="update-item-summary">' + soy.$$escapeHtml(opt_data.changeItem.summary) + '</p>' : '', (opt_data.changeItem.thumbnailable) ? '<div class="update-item-thumbnail-container"><a href="' + soy.$$escapeHtml(opt_data.changeItem.imageUrl) + '"><img id="thumbnail-' + soy.$$escapeHtml(opt_data.changeSetNumber) + soy.$$escapeHtml(opt_data.changeItemNumber) + '" class="thumbnail" src="' + soy.$$escapeHtml(opt_data.changeItem.thumbnailUrl) + '" width="' + soy.$$escapeHtml(opt_data.changeItem.thumbnailWidth) + '" height="' + soy.$$escapeHtml(opt_data.changeItem.thumbnailHeight) + '" style="display: none" /></a></div>' : '', '</div></li>'); return opt_sb ? '' : output.toString(); } catch(e) { return Confluence.Templates.Dashboard.Updates.updateItem_old(opt_data, opt_sb); } }; // Hack to refresh the updates list... var activeTab = AJS.$('#recent-updates > ul.tabs-menu > li.menu-item.active-tab'); var targetLink = activeTab.find('a'); if (targetLink.length == 1) { var backupHref = targetLink.attr("href"); activeTab.removeClass("active-tab"); // Try and avoid any possibility of a redirect loop... targetLink.attr("href","javascript:void(0)"); targetLink.click(); targetLink.attr("href",backupHref); } });
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.