How to use a Context Script to define a Jinja variable

Hello

Frappe v15.17
Dev mode : Y
bench set-config -g server_script_enabled 1

I’m developing a Custom app and define a Website using the Web Page’s Page Builder and selecting the built-in Section with Embed as the template.

Screenshot from 2024-03-18 10-06-08

I then click Edit Values and add the following Jinja variable reference to the Embed HTML

Screenshot from 2024-03-18 10-14-17

Then under the Web Page’s Scripting > Context > Context Script I add

Screenshot from 2024-03-18 10-16-17

However, when I render the webpage the Jinja variable does not resolve

Screenshot from 2024-03-18 10-20-16

What am I doing wrong?

Hi @EugeneP,

I tried using a fixed value with frappe.db.get_value, but it didn’t work. Maybe feature isn’t compatible or isn’t fully developed yet.

Thank You!

Thanks so much @NCP

Have you raised a bug report?

No @EugeneP,

Because I haven’t idea about the Section with Embed and what is the actual use case. It’s mentioned in video so check it.

Thank You!

I also cannot get Dynamic Pages to resolve Jinja variables : Dynamic Pages not resolving Jinja variables

I guess context script you’ve been set can work on content type “HTML” only.