Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cms_manageable.rb tags accessor #442

Closed
Emerson opened this issue Apr 14, 2014 · 3 comments
Closed

cms_manageable.rb tags accessor #442

Emerson opened this issue Apr 14, 2014 · 3 comments

Comments

@Emerson
Copy link
Contributor

Emerson commented Apr 14, 2014

def tags(force_reload = false)
  self.render if force_reload
  @tags ||= []
end

The force reload can cause issues when working with initialized (but unsaved) blocks. It's called by the block.rb#tag method.

Might be a non-issue, but we should investigate.

@eirikurn
Copy link

Not sure if it's related but when I do cms_block_content f.ex. in a navigation (maybe not the bestest practice), I see 7 db queries for every page. It seems to load each page, layout, parent layout, blocks and even all linked files, even if I'm just asking for one "simple" string block by identifier.

cms_block_content calls block.rb#tag, which runs tags(:reload).

@GBH
Copy link
Member

GBH commented May 29, 2014

@eirikurn It's somewhat related. When you use cms_block_content it runs though the tag system to figure out what exactly needs to be rendered out. If you want to grab block content quickly just go through AR: @cms_page.blocks.find_by(:identifier => 'whatever').content

@GBH
Copy link
Member

GBH commented Nov 9, 2017

As of 2.0 Tag parsing system is completely redone. Page does not have tags method anymore.

@GBH GBH closed this as completed Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants