Partials should have a variable outputPage available, so Relative works out-of-the-box with extensions blog Posts and Indexifier #393

Closed
ge0ffrey opened this Issue Feb 26, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@ge0ffrey
Contributor

ge0ffrey commented Feb 26, 2014

To make the file:// protocol work locally, you need to use the Relative extension. But to make Relative work with extensions that change the directory hierarchy (such as Indexifier and blog Posts), you need to pass an extra variable (which I call outputPage) through all partials:

blogAggregation.html.haml:

= partial('blogPostBody.html.haml', :outputPage => page, ...)

blogPostBody.html.haml:

= partial('userBadge.html.haml', :outputPage => page.outputPage, ...)

userBadge.html.haml:

= relative("/common/twitterLogo.png", page.outputPage)

Make partials provide that outputPage out of the box.

I am not the only one running into this (they call it realPage instead outputPage):
jbossorg/bootstrap-community#13

Other names for outputPage: realPage, ancestorPage, rootPage. Name it as you like :) Don't use the name parentPage, because a partial inside a partial should reference not it's parent (= the other partial) but that one above it.

@LightGuard

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Apr 7, 2014

Owner

Using output_page instead of the camel case. Camel case isn't typical in ruby.

Owner

LightGuard commented Apr 7, 2014

Using output_page instead of the camel case. Camel case isn't typical in ruby.

@LightGuard LightGuard closed this in ce23c87 Apr 7, 2014

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