Open zspecza opened 9 years ago
I am also receiving this error
I'm not entirely clear on what this error is describing, I'm sorry! I assume you mean something else, but on template pages, you use item
rather than records
according to the docs.
Sorry Ill run through a little example
say I two records / services, one for posts and one for news items
extensions: [
js_pipeline(files: 'assets/js/*.coffee', out: 'js/build.js', minify: true, hash: true),
css_pipeline(files: 'assets/css/theme.css')
records({
news_feed: {url: 'http://service.co.uk/content/modules/news/'}
pages: {
url: 'http://service.co.uk/content/pages/'
template: "views/_temp.jade"
collection: (d) -> d.data
out: (page) -> "/pages/#{S(page.title).slugify().s}"
}
})
]
The locals I see on the index and single page templates
index.jade - records = [...] - local behaves as expected.
index.jade - item = null local behaves as expected.
post.jade - item = [...] - local behaves as expected.
post.jade - records = null
What happens if I want to use my news feed service inside my (single) post view I cant access it because I dont have access to records
Got it. So essentially, when you are compiling out single view from roots-records, you want to have access to item
as well as the base records
object? I have been able to reproduce this error on one of my projects -- this is the same one you guys are talking about?
Either way, I will close out the one I'm describing today :grinning:
Yes you've got it spot on :) I wasnt expecting you to sort it so soon , I moved away from roots for this project but Ill be back to it again..thanks for open sourcing it
Jamie
On Mon, Jul 27, 2015 at 3:01 PM, Jeff Escalante notifications@github.com wrote:
Got it. So essentially, when you are compiling out single view from roots-records, you want to have access to item as well as the base records object? I have been able to reproduce this error on one of my projects -- this is the same one you guys are talking about?
Either way, I will close out the one I'm describing today [image: :grinning:]
— Reply to this email directly or view it on GitHub https://github.com/carrot/roots-records/issues/15#issuecomment-125217081 .
Ah sorry about that. Would have fixed it earlier honestly, but I'm working part time this year! Will update here shortly when it's resolved :grinning:
No worries appreciate it.. glad you can fix it at all
On Mon, Jul 27, 2015 at 3:24 PM, Jeff Escalante notifications@github.com wrote:
Ah sorry about that. Would have fixed it earlier honestly, but I'm working part time this year! Will update here shortly when it's resolved [image: :grinning:]
— Reply to this email directly or view it on GitHub https://github.com/carrot/roots-records/issues/15#issuecomment-125224513 .
This has been fixed in #23 and a test is in place to prevent any regression. Will be merged and available to everyone today :tada:
:hankey:
index.jade
-records
=[...]
- local behaves as expected.layout.jade
-records
=[]
With settings:
Inside
_page.jade
:records.categories
===undefined
.