Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Gliffy Diagrams in Search Results

Greg Dungca September 29, 2014

Our organization could benefit from the ability to search for terms within Gliffy Diagrams. The Confluence search function provides this feature, but the gliffy diagram search results that are returned are HTML files. 

Ideally this search result would link to the page which the gliffy diagram resides in or the gliffy diagram itself, opened with Gliffy. Instead, the page which is opened is HTML code. Is there a way to change this behaviour?

5 answers

1 accepted

3 votes
Answer accepted
Enrico Schierz
Contributor
January 13, 2016

We wrote a quick and a little bit dirty workarround script: 

If a user clicks on the search result the wiki page that contains the gliffy is opened. 

You can add this script to Settings -> Custom HTML -> At end of the BODY.

<script>
jQuery(function(jQuery){
jQuery("body").on("click","a.search-result-link.visitable",function(e){
e.preventDefault();
var current = jQuery(this);
var href = current.attr("href");
jQuery.getJSON(contextPath+href, function(data){
if(data.contentType == "application/gliffy+json"){
var gotogliffy = current.closest("li").find("a.container").last();
window.location = contextPath+gotogliffy.attr("href");
}else{window.location = contextPath+href;}
}).fail(function(){window.location = window.location = contextPath+href;});
return false;
});
});
</script>

2 votes
Mike Cialowicz
Contributor
September 29, 2014

Hello Greg,

The API hook that enabled this functionality has been removed since Confluence 5.2. We've raised the issue with Atlassian, but unfortunately there are no plans for a fix. You can view the full details of the problem here: https://jira.atlassian.com/browse/CONF-34892 Feel free to watch, vote, and comment on the issue.

The current workaround is to click the small, gray link below the search result description.

Regards,

Mike Cialowicz

Gliffy, Inc.

0 votes
Deleted user January 8, 2019

NOTE: I'm currently testing Confluence Version 6.12.2 and if this script is in place in Confluence Administration / Custom HTML, it causes problems with following Search Results hyperlinks. To test, type something into the Search Box in Confluence. When the results are displayed, attempting to follow links to those items produces a "Page Not Found" error. The workaround is to right-click on the individual search result and choose "Open in New Window" or "Open in New Tab"...otherwise you get the error. 

I removed this script from Custom HTML and the problem I describe above went away.

0 votes
Deleted user January 13, 2016

@Mike Cialowicz, I would like to raise your attention concerning this issue again. Is there a workarround for search result display?

Mike Cialowicz
Contributor
January 14, 2016

Hi Philipp, The current workaround is to click the small, gray link below the search result description in order to navigate to the page containing the Gliffy diagram. Regards, Mike Cialowicz Gliffy

0 votes
System Administrator
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 30, 2015

@Mike Cialowicz: is there way for plug-in to control link presented to a user by search? In that case link to a viewer could be provided instead of a file? Like https://confluence.company.com/plugins/gliffy/viewer.action?inline=false&attachmentId=56328277&name=test instead of https://confluence.company.com/download/attachments/56098836/test?version=2&modificationDate=1443611832573&api=v2 ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events