new page property: display_settings

did committed Feb 03, 2017
commit 393d6a7cf3c3653917e2b7a01890fba62d6945a3
Showing 4 changed files with 15 additions and 2 deletions
generators/page/template.liquid.haml.tt +4 -0
@@ @@ -33,6 +33,10 @@ content_type: <%= config[:content_type] -%>
# editable_elements:
# 'some_block/some_slug': "<text>"
# 'some_block/some_slug': "<relative path to the file under the public/samples folder>"
+
+ # Control the display of the page in the back-office.
+ # display_settings:
+ # hidden: true # hidden for authors?
---
{% extends parent %}
generators/page/template.liquid.tt +4 -0
@@ @@ -37,6 +37,10 @@ content_type: <%= config[:content_type] -%>
# editable_elements:
# 'some_block/some_slug': "<text>"
# 'some_block/some_slug': "<relative path to the file under the public/samples folder>"
+
+ # Control the display of the page in the back-office.
+ # display_settings:
+ # hidden: true # hidden for authors?
---
{% extends parent %}
locomotive/wagon/commands/pull_sub_commands/pull_pages_command.rb b/lib/locomotive/wagon/commands/pull_sub_commands/pull_pages_command.rb +1 -1
@@ @@ -28,7 +28,7 @@ EOF
private
def yaml_attributes(page, locale)
- keys = ['title', 'slug', 'handle', 'position', 'listed', 'published', 'redirect_url', 'is_layout', 'content_type', 'seo_title', 'meta_description', 'meta_keywords']
+ keys = ['title', 'slug', 'handle', 'position', 'listed', 'published', 'redirect_url', 'is_layout', 'content_type', 'seo_title', 'meta_description', 'meta_keywords', 'display_settings']
keys << 'response_type' if page.attributes['response_type'] != 'text/html'
locomotive/wagon/decorators/page_decorator.rb b/lib/locomotive/wagon/decorators/page_decorator.rb +6 -1
@@ @@ -23,7 +23,8 @@ module Locomotive
seo_title meta_keywords meta_description
editable_elements
content_type
- template)
+ template
+ display_settings)
# remove the attributes that end-users might have modified in the back-office
if persisted? && !__persist_content__
@@ @@ -66,6 +67,10 @@ module Locomotive
self[:parent]
end
+ def display_settings
+ self[:display_settings]
+ end
+
def content_type
templatized? ? content_type_id : nil
end