in special sitation inherited templates were not correctly updated
This commit is contained in:
parent
3ee566eae6
commit
1291b68aba
2
doc/TODO
2
doc/TODO
@ -12,6 +12,7 @@ x nav tag:
|
||||
x site | page | parent
|
||||
x retrieve only important page information from mongodb
|
||||
x published by default when importing pages
|
||||
x page redirection
|
||||
|
||||
BACKLOG:
|
||||
|
||||
@ -42,7 +43,6 @@ NICE TO HAVE:
|
||||
- traffic statistics
|
||||
- asset picker (content instance)
|
||||
- page with regexp url ?
|
||||
- page redirection (option)
|
||||
- automatic update !
|
||||
- page not found (front) => if logged in, link to create the page
|
||||
- switch to list (theme assets / assets ?). delete all in once (with checkbox) or see details (updated_at, size, ...etc)
|
||||
|
@ -19,7 +19,9 @@ module Locomotive
|
||||
def parse_parent_template
|
||||
if @template_name == 'parent'
|
||||
if @context[:cached_parent]
|
||||
@context[:parent_page] = @context[:cached_parent]
|
||||
@context[:parent_page] = @context[:cached_parent] #.clone # parent must not be modified
|
||||
|
||||
@context[:cached_parent].instance_variable_set(:@template, nil) # force to reload the template
|
||||
@context[:cached_parent] = nil
|
||||
else
|
||||
@context[:parent_page] = @context[:page].parent
|
||||
@ -31,7 +33,12 @@ module Locomotive
|
||||
|
||||
raise PageNotFound.new("Page with fullpath '#{@template_name}' was not found") if @context[:parent_page].nil?
|
||||
|
||||
@context[:parent_page].template
|
||||
# be sure to work with a copy of the parent template otherwise there will be conflicts
|
||||
parent_template = @context[:parent_page].template.clone
|
||||
|
||||
@context[:parent_page].instance_variable_set(:@template, parent_template)
|
||||
|
||||
parent_template
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user