Sha256: a2f9ceefb3d626e32d759c9cf26b9714401ded594c8c9d89243e85e0664f5bc7

Contents?: true

Size: 844 Bytes

Versions: 4

Compression:

Stored size: 844 Bytes

Contents

module Locomotive
  module Steam
    module Liquid
      module Tags
        class GlobalSection < Locomotive::Steam::Liquid::Tags::Section

          def parse(tokens)
            notify_on_parsing(evaluate_section_name,
              source:     :site,
              id:         "site-#{evaluate_section_name}",
              key:        evaluate_section_name,
              placement:  @section_options[:placement]&.to_sym
            )
          end

          private

          def find_section_content(context)
            context['site']&.sections_content&.fetch(@section_type, nil)
          end

          def set_section_dom_id(context)
            context['section_id'] = "site-#{@section_type}"
          end

        end

        ::Liquid::Template.register_tag('global_section'.freeze, GlobalSection)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
locomotivecms_steam-1.5.0.rc0 lib/locomotive/steam/liquid/tags/global_section.rb
locomotivecms_steam-1.5.0.beta3 lib/locomotive/steam/liquid/tags/global_section.rb
locomotivecms_steam-1.5.0.beta2 lib/locomotive/steam/liquid/tags/global_section.rb
locomotivecms_steam-1.5.0.beta1 lib/locomotive/steam/liquid/tags/global_section.rb