• Resolved sinfomac

    (@sinfomac)


    Hello,

    I’m using the Simile/Exhibit Template (bibexhibit.tpl.php) to show the content of a folder in Mendeley.

    I’d like to use DOI link instead of Mendeley’s one when clicking in a publication title but I haven’t found a reference for it to be used. Is there anywhere to check for the data supplied to Exhibit?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author kochm

    (@kochm)

    In the Simile/Exhibit-Template the url field from the JSON input is used for this automatically (default in Simile/Exhibit) – If you want to have different data you might change the function formatDocumentJSON() in the Mendeley-Plugin to provide different data (e.g. the DOI with a link to resolve it) in the url field.

    Thread Starter sinfomac

    (@sinfomac)

    Hello again,

    not sure if I’m having a bad approach to this, added

      if (isset($doc->identifiers)) {
          if (isset($doc->identifiers->doi)) {
             $urldoi =  'https://dx.doi.org/' . $doc->identifiers->doi;
    	 $tmps .= '"doi" : " ' . json_encode($urldoi) . '",\n'; 
          }
       }

    at formatDocumentJSON() just after the “url” part and

    <span data-ex-content=".doi"></span>

    to bibexhibit.tpl.php to check it, but i get a link to an error message in jsonlint.com with this message in Results:

    Error: Parse error on line 1:
    < !DOCTYPE html PUBL
    ^
    Expecting ‘STRING’, ‘NUMBER’, ‘NULL’, ‘TRUE’, ‘FALSE’, ‘{‘, ‘[‘, got ‘undefined’

    Any suggestion on how to solve this?

    Thread Starter sinfomac

    (@sinfomac)

    Finally found the error, a misplaced pair of quotes.

    $tmps .= ‘”doi” : ‘ . json_encode($urldoi) . “,\n”;

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing DOI in Simile/Exhibit Template’ is closed to new replies.