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

Get html of an instance of a component with site data #118

Closed
cruzanmo opened this issue Aug 5, 2015 · 1 comment
Closed

Get html of an instance of a component with site data #118

cruzanmo opened this issue Aug 5, 2015 · 1 comment
Labels

Comments

@cruzanmo
Copy link

cruzanmo commented Aug 5, 2015

e.g. site.host, site.path, and state.site.name are empty for this component URL http://localhost.dev.nymag.biz:3001/components/article/instances/pr-first.html

state and site are available to the template from this page URI http://localhost.dev.nymag.biz:3001/press/2015/04/first-page.html

Perhaps asking for a URL that would render the component with the site data; something like http://localhost.dev.nymag.biz:3001/press/components/article/instances/pr-first.html

@cruzanmo cruzanmo changed the title Get html of an instance of a component with site data. Allow components API within a sub-directory Aug 5, 2015
@cruzanmo cruzanmo added feature and removed bug labels Aug 5, 2015
@cruzanmo cruzanmo changed the title Allow components API within a sub-directory Get html of an instance of a component with site data Aug 5, 2015
@TakenPilot
Copy link
Contributor

Things at /pages and /components have no site. They're shared between all sites. Therefore, there is no site.whatever. If you want site data in a component, and if you want to get it dynamically like that, then you have to save that site data to that specific component. However, whatever you're trying to do, I'd recommend restructuring it to be in the context of a component feature, rather than something specific to a site. Then the other users of that component can also use your new feature.

If it's just trying to get js or css to show up, nevermind. There's another solution that we're working on that might work for that.

Alternatively, there is a PR now (#120) that may solve your issue temporarily.

Also note: You never need to say state unless you're trying to refer to this. State was needed because some template languages don't have a concept of this, so we put it into state.

@cruzanmo @yoshokatana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants