-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Can't use expressions plugin with it #7
Comments
Hi, I got to this task #7, I found some problems that were fixed, but the question remains about
this value is not currently available and how would you like it to work ? |
Imagine I already have an object with data that I want to make available to the With that, I should be able to do: <fetch url="...">
{{ language }}
<!-- now render response -->
{{ response.title }}
</fetch> ... and get: en
<!-- now render response -->
response title text If I do this now, I get an error because Makes sense? |
I so believe that we need a mechanism that would tell expression what to process and what to process then so ? |
So looking at
plugins.before
andplugins.after
, I understand you can pass an array of PostHTML plugins to run before and after the remote content is fetched.I'm trying to pass in
posthtml-expressions
, because I already have some variables in context, that I need to use inside the<fetch>
tag:At this point, I would expect both the
response
variable fromposthtml-fetch
and thepage
variable that I'm passing inplugins.before
withexpressions
to be available.I'll use a real example so you can reproduce it - imagine I already had
page.title
in context:This results in a
ReferenceError: page is not defined
One way around it is if
posthtml-fetch
would accept alocals
option.However, I think passing in
expressions
with its own locals, before the content is fetched, should work.Am I missing something here?
The text was updated successfully, but these errors were encountered: