Sha256: 5804f8d37f7bdc459a99071a1b28c8b8f32c714e03b666292f0a7b0a8efc397f
Contents?: true
Size: 955 Bytes
Versions: 8
Compression:
Stored size: 955 Bytes
Contents
module Pageflow class HomeButton attr_reader :revision, :site def initialize(revision, site) @revision = revision @site = site end def url revision.configuration['home_url'].presence || site_home_button_url end def enabled? revision.configuration['home_button_enabled'] && revision.theme.has_home_button? && url.present? end def url_value revision.configuration['home_url'] end def enabled_value revision.configuration['home_button_enabled'] end private def site_home_button_url if site.home_url.present? options = Pageflow.config.site_url_options(site) || {} Pageflow::Engine.routes.url_for(options.merge(controller: 'pageflow/entries', action: 'index', only_path: !options[:host])) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems