D
D
Dymok2020-03-21 20:44:32
npm
Dymok, 2020-03-21 20:44:32

How to pass a variable to a chunk via a snippet in MODX Revo?

There is a chunk, you need to pass the parent variable from it to the chunk, which is called by the snippet:



I'm trying to display in the js-object-prices chunk, but nothing happens.
In this case, if you do not specify an output template, then this value is transmitted. 5e7652f0e3665873346293.jpeg
Why does it not work like this and how can the problem be solved?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
srko, 2019-08-24
@srko

What exactly are you trying to run? Gulp or NPM?
If Gulp, then you are doing it not quite right, look in the manual - it is launched by the "gulp" command. But gulpfile.js has other points of contention.
If it's an NPM script, then you're missing the "start" script. Look at the package.json file, there is only ""scripts": "test"".

D
DeveloperV, 2019-08-24
@developerV

I would like to start liveserver so that I don’t have to write gulp sass every time,
but the gulp serve command does not work, it gives an error

λ gulp serve
assert.js:339
    throw err;
    ^

AssertionError [ERR_ASSERTION]: Task function must be specified
    at Gulp.set [as _setTask] (C:\Users\Varfo\Desktop\site\node_modules\undertaker\lib\set-task.js:10:3)
    at Gulp.task (C:\Users\Varfo\Desktop\site\node_modules\undertaker\lib\task.js:13:8)
    at Object.<anonymous> (C:\Users\Varfo\Desktop\site\gulpfile.js:24:6)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)

A
Anton Tarasov, 2020-03-21
@an-tar

those. in the js-object-prices chunk you output and it's empty?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question