Skip to content
architolk edited this page Nov 29, 2016 · 4 revisions

You use a NavbarAppearance if you want to add a navigation bar (menu) to your pages. If you also want to include a search input field, use the NavbarSearchAppearance.

You normally create a elmo:Part as a NavbarAppearance and use elmo:contains to include the navbar into any representation you want.

Every item in the navbar will be a blank node that is attached to the elmo:Part using a elmo:data property. And every item has the following properties:

  • rdfs:label: The label of the item (multilanguage support is included);
  • xhtml:link: The hyperlink to a specific URL;
  • elmo:index: (optional) The placement of a item.

When you specifiy the hyperlink, you can use absolute or relative url's. The LDT processes these links in a different manner:

  • A link with a domain name (http://somesite/page) will remain the exact same link;
  • An absolute link (starting with a slash) without a domain (/query/item1) will remain the exact same link. Your browser will add the domain name of the current site;
  • A relative link (without a starting slash and without a domain (query/item1) will be prefixed with the docroot (if any) and the subdomain of your stage (if any). Use this option if you need to deploy your configurations on different machines (for example: if one machine has a docroot and another doesn't).

Navbar appearance

Example

@prefix elmo: <http://bp4mc2.org/elmo/def#>.
@prefix xhtml: <http://www.w3.org/1999/xhtml/vocab#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix stage: <http://localhost:8080/stage#>. 
stage:menu a elmo:Part;
	elmo:appearance elmo:NavbarSearchAppearance;
	elmo:data [
		rdfs:label "Linked Data Theater"@nl;
		rdfs:label "Linked Data Theatre"@en;
		elmo:data [
			elmo:index "1";
			rdfs:label "Submenu";
			elmo:data [elmo:index "1"; rdfs:label "Item 1"; xhtml:link "/query/item1"];
			elmo:data [elmo:index "2"; rdfs:label "Item 2"; xhtml:link "/query/item2"];
			elmo:data [elmo:index "3"; rdfs:label "Item 3"; xhtml:link "/query/item3"];
		];
		elmo:data [
			elmo:index "2";
			rdfs:label "A head menu-item"@en;
			rdfs:label "Een hoofdmenu-item"@nl;
			xhtml:link "http://github.com"
		];
	];
.
Clone this wiki locally