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

Properties from templateData and helpers are not copied to *this* #11

Open
edzis opened this issue Jul 30, 2013 · 2 comments
Open

Properties from templateData and helpers are not copied to *this* #11

edzis opened this issue Jul 30, 2013 · 2 comments

Comments

@edzis
Copy link

edzis commented Jul 30, 2013

I am defining some data in docpad config

templateData:
    site:
        navigation: [
            { href:'/#', label:'home' }
            { href:'/#what-we-do', label:'what we do' }
            { href:'/#clients', label:'clients' }
            { href:'/#blog', label:'blog' }
            { href:'/#contact', label:'contact' }
        ]

site is available in the scope of a page and template, but it is not a member of this.
This raises problems when i am using partials plugin and passing the scope to it !=partial("sections/header.html.jade", this)
At that moment the following evaluations result in false

hasOwnProperty('site')
hasOwnProperty('getFilesAtPath')

This is different to how it behaves on the default parser for .eco files. Where they evaluate to true and the same config variables are also accessed inside the partial.

@radiodario
Copy link

I'm plain not able to access any property in templateData from within the document - everything is undefined.

@timaschew
Copy link

Try out to use a jade mixin instead of the partial plugin, jade has this feature built-in

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