[SOLVED] Need help with REGEX transformations in the sitemap

What you can do instead is use a JAVASCRIPT transform.

You will need to write a bit of javascript code that do the transformation

** Install the JAVASCRIPT transformation**

Create a file called title.js in the transform folder with the following contents:

(function(jsonString) {
var data = JSON.parse(jsonString);
var title = data.title;
var maxLength = 25; // Set-up here what max length you want your string to be
if (title.length > maxLength) {
    title = title.substring(0, maxLength +1);
}
return title;
})(input)

And your sitemap element becomes:

Text item=VolumioStatInfo label="Title [JS(title.js):%s]"
1 Like