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

Widgets can't access page data? #52

lynnfaraday opened this issue Jul 4, 2012 · 3 comments


None yet
2 participants
Copy link

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.


This comment has been minimized.

Copy link

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!


This comment has been minimized.

Copy link
Contributor Author

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

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.


This comment has been minimized.

Copy link

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
You can’t perform that action at this time.