Skip to content

Commit

Permalink
radius tag page:template:name name now works as expected. Closes #5.
Browse files Browse the repository at this point in the history
mock_data.yml file can also include a override on the page data object:

page:
  template:
    name: "foo"
  • Loading branch information
zeroedin committed Aug 28, 2014
1 parent 0a6d9ba commit 1478926
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions hammer/services/tags/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,24 @@ class Page < TagContainer
tag 'page:template' do |tag|
# tag.locals.page_template = tag.locals.page.template
# tag.expand
Hammer.error "page:template tag is not yet implemented"
if tag.globals.context.data && tag.globals.context.data["page"]
# binding.pry
if tag.globals.context.data["page"]["template"]
tag.locals.page_template = tag.globals.context.data["page"]["template"]
end
end
tag.expand

end

tag 'page:template:name' do |tag|
# tag.locals.page_template.name
Hammer.error "page:template:name tag is not yet implemented"
if tag.locals.page_template && tag.locals.page_template.name
name = tag.local.page_template.name
else
name = File.basename(tag.context.globals.context.request.path, ".*")
end
name
end


Expand Down

0 comments on commit 1478926

Please sign in to comment.