eSearch results

1407
2
Jump to solution
02-10-2016 11:46 AM
RudoDuncan
New Contributor II

Robert Scheitlin, GISP

Hey Robert is there a easy method to make my link appear in the title section of my results?

Capture.JPG

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Rudo,

  Easy... Not exactly. In the Widget.js you would search for and update this block (based on line 1):

if (titlefield && upperCaseFieldName === titlefield.toUpperCase()) {
              if(layerConfig.name === 'Your layers name'){
                title = "<a href='" + lyrQLinks[0].link + "' target='_blank' title='" + lyrQLinks[0].alias + "'>" + lyrQLinks[0].alias + "</a>";
              }else{
                title = value;
              }
            } else {

And then in List.js

        var rTitle = domConstruct.toDom(item.title);
        //var rTitle = domConstruct.create("strong");
        domAttr.set(rTitle, "id", this.id.toLowerCase()+item.id);
        domClass.add(rTitle, "label");
        //rTitle.textContent = rTitle.innerText = item.title;
        domConstruct.place(rTitle, div);

This will still leave you with the issue of having the link listed in the results body and in the title of both the search results and the popups. I don't have time to spend on that portion.

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Rudo,

  Easy... Not exactly. In the Widget.js you would search for and update this block (based on line 1):

if (titlefield && upperCaseFieldName === titlefield.toUpperCase()) {
              if(layerConfig.name === 'Your layers name'){
                title = "<a href='" + lyrQLinks[0].link + "' target='_blank' title='" + lyrQLinks[0].alias + "'>" + lyrQLinks[0].alias + "</a>";
              }else{
                title = value;
              }
            } else {

And then in List.js

        var rTitle = domConstruct.toDom(item.title);
        //var rTitle = domConstruct.create("strong");
        domAttr.set(rTitle, "id", this.id.toLowerCase()+item.id);
        domClass.add(rTitle, "label");
        //rTitle.textContent = rTitle.innerText = item.title;
        domConstruct.place(rTitle, div);

This will still leave you with the issue of having the link listed in the results body and in the title of both the search results and the popups. I don't have time to spend on that portion.

0 Kudos
RudoDuncan
New Contributor II

No worries, I will look into it and see what I my output looks like. Thanks again for the help Robert, you're a gentleman and a scholar.

0 Kudos