- template#conditional "is_homepage" is_homepage;
-
- let table = sth#map (function [`String url; `String label; _] ->
- let is_linked =
- match page with
- | None -> true
- | Some page when page = url -> false
- | _ -> true in
- let id = id_of_url url in
- [ "url", Template.VarString url;
- "label", Template.VarString label;
- "is_linked", Template.VarConditional is_linked;
- "id", Template.VarString id ]
- | _ -> assert false) in
-
- template#table "sitemenu" table;
-
+ template#conditional "is_homepage" is_homepage;
+
+ let table = List.map
+ (fun (url, label, _) ->
+ let is_linked =
+ match page with
+ | None -> true
+ | Some page when page = url -> false
+ | _ -> true in
+ let id = id_of_url url in
+ [ "url", Template.VarString url;
+ "label", Template.VarString label;
+ "is_linked", Template.VarConditional is_linked;
+ "id", Template.VarString id ]
+ ) rows in
+
+ template#table "sitemenu" table;
+ )
+ else (* if we have no hostid *) (
+ template#set "theme_css" "/_css/standard.css";
+ template#conditional "has_host_css" false;
+ template#set "powered_by_name" (Cocanwiki_version.package ^ " " ^
+ Cocanwiki_version.version);
+ template#set "powered_by_url" "http://sandbox.merjis.com/";
+ template#conditional "search_box" false;
+ template#conditional "branding" false;
+ template#set "brand" "";
+ template#conditional "has_brand_tagline" false;
+ template#set "brand_tagline" "";
+ template#conditional "has_brand_description" false;
+ template#set "brand_description" "";
+ template#conditional "has_pagebug" false;
+ template#set "pagebug" "";
+ template#conditional "is_homepage" false;
+ template#table "sitemenu" [];
+ );