Class: Spree::PageSections::FeaturedTaxons

Inherits:
Spree::PageSection show all
Defined in:
app/models/spree/page_sections/featured_taxons.rb

Constant Summary

Constants inherited from Spree::PageSection

Spree::PageSection::BACKGROUND_COLOR_DEFAULT, Spree::PageSection::BORDER_COLOR_DEFAULT, Spree::PageSection::BOTTOM_BORDER_WIDTH_DEFAULT, Spree::PageSection::BOTTOM_PADDING_DEFAULT, Spree::PageSection::TEXT_COLOR_DEFAULT, Spree::PageSection::TOP_BORDER_WIDTH_DEFAULT, Spree::PageSection::TOP_PADDING_DEFAULT

Instance Attribute Summary

Attributes inherited from Spree::PageSection

#default_blocks

Instance Method Summary collapse

Methods inherited from Spree::PageSection

#available_blocks_to_add, #blocks_available?, #can_be_deleted?, #can_be_sorted?, #can_sort_blocks?, #copy_rich_text_fields_from, #deep_clone, #deep_clone_links, #display_name, #dup, #lazy?, #lazy_path, #restore_design_settings_to_defaults, #rich_text_fields, #role, role, #theme, #to_partial_path

Instance Method Details

#allowed_linkable_typesObject



19
20
21
22
23
# File 'app/models/spree/page_sections/featured_taxons.rb', line 19

def allowed_linkable_types
  [
    [Spree.t(:taxon), 'Spree::Taxon']
  ]
end

#default_linkable_resourceObject



29
30
31
32
# File 'app/models/spree/page_sections/featured_taxons.rb', line 29

def default_linkable_resource
  @default_linkable_resource ||= Spree::Taxon.where(parent: store.taxonomies.first.root).first ||
                                  store.theme_pages.find_by(type: 'Spree::Pages::Homepage')
end

#default_linkable_typeObject



25
26
27
# File 'app/models/spree/page_sections/featured_taxons.rb', line 25

def default_linkable_type
  default_linkable_resource.class.to_s
end

#icon_nameObject



11
12
13
# File 'app/models/spree/page_sections/featured_taxons.rb', line 11

def icon_name
  'layout-grid'
end

Returns:

  • (Boolean)


15
16
17
# File 'app/models/spree/page_sections/featured_taxons.rb', line 15

def links_available?
  true
end