https://github.com/bobthecow/mustache.php/releases
The latest one has some security fixes.
]]>Templates type: script type=text/plain
Simple source example
<script type="text/plain" template="amp-mustache"> <i>t</i> <b>a</b> <div>g</div> </script>
Output after processing
<script type="text/plain" template="amp-mustache"> <i>t <b>a <div>g </script>
Is there a way to prevent this behavior?
]]>I recently updated our custom post type index to pull directly from the WP api using amp-list and mustache, which is working well.
I am now working on implementing options to filter and sort the results.
I’ve gone over every example I can find, but I can’t seem to get the taxonomy terms to output in a single select.
The terms are being outputted, but as individual selects (you can see it in action here -> https://winefolly.staging.wpengine.com/grapes-wines/. I’ve tried every variation I can think of, but to no avail.
Here is the code I am using to generate the select:
<div class="container uk-text-left">
<amp-list height="80" template="styles-list" layout="fixed-height" src="https://winefolly.staging.wpengine.com/wp-json/wp/v2/style_type/" items=".">
<div placeholder>Loading...</div>
<div fallback>Failed to load wine styles</div>
<template type="amp-mustache" id="styles-list">
<select>
<option value="">Filter by Style</option>
{{#.}}
<option value="{{slug}}">{{name}}</option>
{{/.}}
</select>
</template>
</amp-list>
</div>
I’ve tried moving the selects to outside the template tag, but then the terms output as plain text and the select is empty.
Any ideas what I’m missing?
TIA,
Chris
I just had a problem with using a template – if there is another plugin, that uses mustache. I’ve got an error for redeclare the mustache class by activating the template.
I’ve fixed this manually:
– hungryfeed.php:519
if ( ! class_exists(‘Mustache’)) include_once(plugin_dir_path(__FILE__).’libs/Mustache.php’);
-instead of:
include_once(plugin_dir_path(__FILE__).’libs/Mustache.php’);
And now it works properly. A included fix for the next release would be great.
cheers
kopfpirat
https://www.ads-software.com/plugins/hungryfeed/
]]>it’s good to see others trying to push the adoption of a template engine into wordpress
I did try to publish to www.ads-software.com a plugin which is very similar to yours (it’s a very simple plugin, it just adds support to mustache in both PHP and JS implementation) – the original repo can be found at: https://github.com/nekojira/mustacciuoli
for some reason, though, my plugin was not approved while yours was… the reasons they mentioned were along the lines it was like a framework or introduces changes in WordPress standard practices
anyways, if you’d think it’d be cool to have joint project for this (a bit like the guys at Upstatement did for Twig (see https://upstatement.com/timber/) I’m in
cheers
https://www.ads-software.com/plugins/mustache-php-js/
]]>{{taxonomy}}
but I need to access it in checkboxes-item.html to define a class like this<input type="checkbox" id="{{value}}" name="{{name}}" value="{{value}}" class="{{taxonomy}}" {{#is-selected}}checked="checked"{{/is-selected}} />
I guess I have to change the data submitted to the Mustache-Template in walkers.php, but I don’t know how.
https://www.ads-software.com/extend/plugins/query-multiple-taxonomies/
]]>