Skip to main content

Questions tagged [js]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
28 views

Adding a nonce tag to an inline code block

While it's possible to pass an html element into a JS file declaration using 'with' as in: {% js '/url/here' with { nonce: { nonce } } %} this approach is not available for a JS inline code block for ...
Jason McKinney's user avatar
2 votes
1 answer
191 views

How to use ajax call to retrieve data from craft cms entries to use in php application

I'm building a static webpage with php and Javascript. I have setup all my data in craft cms entries. I want to use ajax to retrieve the data from craft and just display it on my webpage. How do I do ...
Alyx's user avatar
  • 23
1 vote
0 answers
80 views

Maintaining the same page creating experience in a headless Craft CMS configuration - Next.js

I don't see a clear path to get the full page creating experience in any headless configuration as is available in Craft/Twig. The routing in next.js specifically I think is the main obstacle. Next.js ...
chris's user avatar
  • 21
1 vote
1 answer
67 views

Showing and hiding details (price, sale price, sku etc)when product variant is selected on details page

I currently have price, sku and variant title swapping when clicking between variants on a products details page. This works with AlpineJS and looks something this. https://codepen.io/amasci/pen/...
Terry Upton's user avatar
  • 1,894
4 votes
1 answer
729 views

Interpret TWIG's {% js %} as <script> in PHPStorm

Does anyone know how to get PHPStorm interpret {% js %} as <script> for correct syntax highlighting in PHPStorm? Background: I'am always doing this: {% js at endBody %} {% if false %}<...
Matthias Redl-Mann's user avatar