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

Widgets can't access page data? #52

Closed
lynnfaraday opened this Issue Jul 4, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@lynnfaraday
Contributor

lynnfaraday commented Jul 4, 2012

I'm trying to make a custom comments widget that would use the current page url. In the previous version I could just do {{url}} in the custom_comments partial, but it seems that doesn't work in 1.0. The widget layout can access config data through {{config}} but not {{page}} or {{url}} or anything like that.

Am I missing something? Thanks.

@plusjade

This comment has been minimized.

Show comment
Hide comment
@plusjade

plusjade Jul 5, 2012

Member

You're right, widgets only receive their config data and nothing else. I had originally planned to send in the global payload but it proved to be more difficult than I thought.

Ultimately I think including the global payload makes sense so it will get done -- I just wanted to ship the minimum viable product!

Member

plusjade commented Jul 5, 2012

You're right, widgets only receive their config data and nothing else. I had originally planned to send in the global payload but it proved to be more difficult than I thought.

Ultimately I think including the global payload makes sense so it will get done -- I just wanted to ship the minimum viable product!

@lynnfaraday

This comment has been minimized.

Show comment
Hide comment
@lynnfaraday

lynnfaraday Jul 15, 2012

Contributor

@plusjade: I understand it's not a priority for the first release - that's cool. I would really like to get this working for my own widget, though, and I'm happy to do the work myself. I have modified widgets.rb so that it gets the global payload much like pages do:

  def self.payload(widget_config)
      payload = Ruhoh::DB.payload.dup
      payload['config'] = widget_config
      payload
    end

Now it has access to all the static database stuff. What I can't figure out is how to get it the current page context. I'll keep hammering away at it, but if you can give me any pointers to get started, that'd be great.

Contributor

lynnfaraday commented Jul 15, 2012

@plusjade: I understand it's not a priority for the first release - that's cool. I would really like to get this working for my own widget, though, and I'm happy to do the work myself. I have modified widgets.rb so that it gets the global payload much like pages do:

  def self.payload(widget_config)
      payload = Ruhoh::DB.payload.dup
      payload['config'] = widget_config
      payload
    end

Now it has access to all the static database stuff. What I can't figure out is how to get it the current page context. I'll keep hammering away at it, but if you can give me any pointers to get started, that'd be great.

@plusjade

This comment has been minimized.

Show comment
Hide comment
@plusjade

plusjade Jun 9, 2013

Member

Full page context added to widgets at c564232

Member

plusjade commented Jun 9, 2013

Full page context added to widgets at c564232

@plusjade plusjade closed this Jun 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment