Skip to content

Commit

Permalink
adding prefLabels to the values passed to javascript, fixes #438
Browse files Browse the repository at this point in the history
  • Loading branch information
henriyli committed Feb 23, 2016
1 parent 36f0f12 commit 293f489
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions view/scripts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var waypoint_results = {{ parameters.searchLimit }};
{% endif %}
{% if request.page == 'page' and search_results and search_results|length == 1 %}
var uri = "{{ search_results|first.uri }}";
var prefLabels = [{'lang': '{{ search_results|first.label.lang }}','label': '{{ search_results|first.label }}'}{% for lang in search_results|first.foreignLabels %}{% for literal in lang %}{% if literal.type == 'skos:prefLabel' %},{'lang': '{{literal.lang}}', 'label': '{{literal.label}}'}{% endif %}{% endfor %}{% endfor %}];
console.log(prefLabels);
{% endif %}
{% if request.vocab and request.vocab.uriSpace %}
var uriSpace = "{{ request.vocab.uriSpace }}";
Expand Down

0 comments on commit 293f489

Please sign in to comment.