Module: Katalyst::Content::FrontendHelper

Defined in:
app/helpers/katalyst/content/frontend_helper.rb

Instance Method Summary collapse

Instance Method Details

#content_item_tag(item) ⇒ Object



28
29
30
# File 'app/helpers/katalyst/content/frontend_helper.rb', line 28

def content_item_tag(item, ...)
  FrontendBuilder.new(self, item).render(...)
end

#render_content(version) ⇒ ActiveSupport::SafeBuffer, ...

Render all items from a content version as HTML Example usage:

<%= render_content(version) %>


11
12
13
14
15
16
17
18
19
# File 'app/helpers/katalyst/content/frontend_helper.rb', line 11

def render_content(version)
  capture do
    cache version do
      without_partial_path_prefix do
        concat render partial: version.tree.select(&:visible?)
      end
    end
  end
end

#render_content_items(items) ⇒ Object



21
22
23
24
25
26
# File 'app/helpers/katalyst/content/frontend_helper.rb', line 21

def render_content_items(items)
  items = items.select(&:visible?)
  without_partial_path_prefix do
    render partial: items if items.any?
  end
end