Module: PagesCore::PageModel::Templateable

Extended by:
ActiveSupport::Concern
Included in:
Page
Defined in:
app/models/concerns/pages_core/page_model/templateable.rb

Instance Method Summary collapse

Instance Method Details

#default_subtemplateObject


19
20
21
22
23
24
25
# File 'app/models/concerns/pages_core/page_model/templateable.rb', line 19

def default_subtemplate
  template_config.value(:sub_template) ||
    default_template ||
    subtemplate_with_postfix ||
    singularized_subtemplate ||
    template
end

#templateObject


14
15
16
17
# File 'app/models/concerns/pages_core/page_model/templateable.rb', line 14

def template
  return self[:template] if self[:template].present?
  inherited_or_default_template
end

#template_configObject


10
11
12
# File 'app/models/concerns/pages_core/page_model/templateable.rb', line 10

def template_config
  PagesCore::Templates::TemplateConfiguration.new(template)
end