I am trying to embed a few lines of simple javascript in on page, but it clearly isn’t working. I’m sure there is just something basic I’m missing the documentation suggests that there is an elaborate solution, which I’m struggling to follow with my current understanding of Grav.
The code structured like this (“site.com” in the example is a url external to the Grav site I’m building:
If there is just something conceptual about Grav I don’t understand, please feel free to point me in the right direction. Or if there is a model to follow that would be great too.
Okay, but what actually is this supposed to do and how it doesn’t work?
To help you solve your problem, one would need, well, some more details.
Where did you put this code? What did you expect it to do? What it actually did? Was there any code rendered in the final source? Were there any console messages?
The code displays a form from an external app. I have extensive experience embedding this app on other PHP CMS’s like Joomla and Pagekit. Works fine each time.
I put the code in a Modular which I then added to an existing page.
There is no console error. The code does not display.
I performed the following test to make sure the Modular was displaying:
Remove script
Add simple text.
Save and refresh
Simple text displays exactly where I would expect. However, searching the for the Modular id in the console reveals that it is not there which also seems odd.
Maybe try this:
Insert all those pretty tags in special Template (Twig ) file, and then add a module using this template to your modular, in the place where you’d like this form appear, and let me know what happens