diff --git a/blueprints/fields/link-location.yml b/blueprints/fields/link-location.yml new file mode 100644 index 0000000..b8041df --- /dev/null +++ b/blueprints/fields/link-location.yml @@ -0,0 +1,24 @@ +type: fields + +fields: + linkLocation: + label: Link Location + type: select + options: + type: query + query: site.linkLocations.toStructure + text: "{{ item.description }}" + value: "{{ item.location }}" + linkIndex: + label: Link Position + type: number + min: 1 + default: 10 + linkText: + label: Link Text + help: Custom link text to use instead of the title. + type: text + linkIcon: + label: Link Icon + help: Font Awesome icon that is used for the link text. + type: text diff --git a/blueprints/fields/link-locations.yml b/blueprints/fields/link-locations.yml new file mode 100644 index 0000000..c005d62 --- /dev/null +++ b/blueprints/fields/link-locations.yml @@ -0,0 +1,15 @@ +type: fields + +fields: + linkLocations: + label: Link Locations + type: structure + fields: + description: + label: Location Description + type: text + help: A friendly description for selecting this location on pages. + location: + label: Location Key + type: text + help: This is what is used when finding links for this location. diff --git a/index.php b/index.php index 59b6c40..569c895 100644 --- a/index.php +++ b/index.php @@ -21,6 +21,13 @@ Kirby::plugin( ], ], ], + "blueprints" => [ + "fields/link-locations" => __DIR__ . "/blueprints/fields/link-locations.yml", + "fields/link-location" => __DIR__ . "/blueprints/fields/link-location.yml", + ], + "snippets" => [ + "navbar/primary" => __DIR__ . "/snippets/navbar/primary.php", + ], "hooks" => [ /** * To add this hook to a plugin, change the option() call to use the plugins name. diff --git a/snippets/navbar/primary.php b/snippets/navbar/primary.php new file mode 100644 index 0000000..afcd598 --- /dev/null +++ b/snippets/navbar/primary.php @@ -0,0 +1,77 @@ +