new site attribute: metafields_label

did committed Mar 16, 2016
commit 97f1b191aa8b441311cbe06adbf746588048cc97
Showing 5 changed files with 22 additions and 2 deletions
generators/blank/config/site.yml.tt +4 -0
@@ @@ -27,6 +27,10 @@ seo_title: <%= @name %>
meta_keywords: "some meta keywords"
meta_description: "some meta description"
+ # You can change the label of the metafields section in the Locomotive Engine left sidebar.
+ # Default label is "Properties".
+ # metafields_label: Store settings
+
# Each site can have its own set of custom properties organized in namespaces.
# First, define namespaces and their fields in the config/metafields_schema.yml file.
# Finally, set default values below as described in the example.
generators/bootstrap/config/site.yml.tt +4 -0
@@ @@ -27,6 +27,10 @@ seo_title: <%= @name %>
meta_keywords: "some meta keywords"
meta_description: "some meta description"
+ # You can change the label of the metafields section in the Locomotive Engine left sidebar.
+ # Default label is "Properties".
+ # metafields_label: Store settings
+
# Each site can have its own set of custom properties organized in namespaces.
# First, define namespaces and their fields in the config/metafields_schema.yml file.
# Finally, set default values below as described in the example.
generators/foundation5/config/site.yml.tt +4 -0
@@ @@ -27,6 +27,10 @@ seo_title: <%= @name %>
meta_keywords: "some meta keywords"
meta_description: "some meta description"
+ # You can change the label of the metafields section in the Locomotive Engine left sidebar.
+ # Default label is "Properties".
+ # metafields_label: Store settings
+
# Each site can have its own set of custom properties organized in namespaces.
# First, define namespaces and their fields in the config/metafields_schema.yml file.
# Finally, set default values below as described in the example.
locomotive/wagon/decorators/site_decorator.rb b/lib/locomotive/wagon/decorators/site_decorator.rb +6 -2
@@ @@ -12,6 +12,10 @@ module Locomotive
(__getobj__.domains || []) - ['localhost']
end
+ def metafields_label
+ self[:metafields_label]
+ end
+
def metafields_schema
self[:metafields_schema].try(:to_json)
end
@@ @@ -37,7 +41,7 @@ module Locomotive
end
def __attributes__
- %i(name handle robots_txt locales timezone seo_title meta_keywords meta_description picture metafields_schema metafields)
+ %i(name handle robots_txt locales timezone seo_title meta_keywords meta_description picture metafields_schema metafields metafields_label)
end
def edited?
@@ @@ -49,7 +53,7 @@ module Locomotive
class UpdateSiteDecorator < SiteDecorator
def __attributes__
- %i(picture locales metafields_schema metafields)
+ %i(picture locales metafields_schema metafields metafields_label)
end
end
locomotive/wagon/generators/site_metafields.rb b/lib/locomotive/wagon/generators/site_metafields.rb +4 -0
@@ @@ -21,6 +21,10 @@ module Locomotive
def add_instructions
append_to_file 'config/site.yml', <<-EOF
+ # You can change the label of the metafields section in the Locomotive Engine left sidebar.
+ # Default label is "Properties".
+ # metafields_label: Store settings
+
# Each site can have its own set of custom properties organized in namespaces.
# First, define namespaces and their fields in the config/metafields_schema.yml file.
# Finally, set default values below as described in the example.