Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new app function app:breadcrumb-var2 (#325) #328

Merged
merged 6 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
a much simpler solution? (#325)
  • Loading branch information
jakosch committed Nov 17, 2019
commit de62d3aaa16bdc4b25a93e35fe8576108a3b427b
28 changes: 0 additions & 28 deletions modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -259,34 +259,6 @@ declare
}
};


declare
%templates:default("lang", "en")
function app:breadcrumb-var2($node as node(), $model as map(*), $lang as xs:string) as element() {
let $docID := $model('docID')
let $breadcrumb :=
for $document in $docID
return switch ($document)
case "A070001" return "editorialGuidelines-text"
case "A070002" return "about"
case "A070003" return "bio"
case "A070004" return "faq"
case "A070006" return "projectDescription"
case "A070009" return "contact"
case "A070010" return "editorialGuidelines-music"
case "A070011" return "volContents"
case "A070012" return "apiDocumentation"
case "A070013" return "credits"
case "A070090" return "specialVolume"
default return $docID
return
element {node-name($node)} {
$node/@*,
if (matches($breadcrumb,'[a-z]')) then lang:get-language-string($breadcrumb,$lang) else $breadcrumb
}
};


declare
%templates:wrap
%templates:default("lang", "en")
Expand Down
2 changes: 1 addition & 1 deletion templates/var.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 data-template="app:document-title">CARL MARIA VON WEBER AN
<li><a href="$link/index">Home</a></li>
<li data-template="app-shared:if-not-matches" data-template-key="docID" data-template-value="A070003"><span data-template="app:breadcrumb-var"/></li>
<li data-template="app-shared:if-matches" data-template-key="docID" data-template-value="A070003"><a href="$link/A002068.html">Carl Maria von Weber</a></li>
<li><span data-template="app:breadcrumb-var2"/></li>
<li data-template="app-shared:if-not-matches" data-template-key="docID" data-template-value="A070090"><span data-template="app:document-title"></span></li>
</ol>
<ol class="breadcrumb" data-template="app-shared:if-matches" data-template-key="docType" data-template-value="thematicCommentaries">
<li><a href="$link/index">Home</a></li>
Expand Down