Questions tagged [liquid-template]

Liquid is an open-source template language created by Shopify and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. This tag should be used for questions relating to Liquid templating systems (for example interactions between Shopify's theme template files). Use the related [liquid] tag for generic liquid questions.

Liquid is a templating engine for creating web pages. From the Liquid website:

Liquid is an extraction from the e-commerce system Shopify. Shopify powers many thousands of e-commerce stores which all call for unique designs. For this we developed Liquid which allows our customers complete design freedom while maintaining the integrity of our servers.

Liquid has been in production use since June 2006 and is now used by many other hosted web applications.

It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works excellently as a stand alone library.

Liquid has been in production use at Shopify since 2006, and is also used as the main templating engine on GitHub pages through the Jekyll static site generator.

57 questions
0
votes
0 answers

removing brackets when calling data from a multi-dimensional array using JSON on Liquid

The data on JSON would be a multi-dimensional array, called by a Liquid template as follows: array-inception: [ prompt1: "string", variable1: "(int/float)", evento_prompt_2:"string", …
0
votes
0 answers

Extracting specific fields from a JSON object using Liquid template in SharePoint - Not getting expected output

I am trying to extract certain fields from the following JSON object using a liquid template in a SharePoint site, but I am not getting the desired output. Here is the JSON object: { "value": [ { "searchTerms": [], …
cb0008
  • 93
  • 1
  • 8
0
votes
1 answer

Properly formatting an array in a liquid template for a JSON object

I am trying to create a JSON object using a liquid template, but the fields array in my output is not properly formatted. For example, my input is: { "queryString": "id:00000000-0000-0000-0000-000000000000", "fields": [ …
cb0008
  • 93
  • 1
  • 8
0
votes
2 answers

A "Copy Everything" liquid template for JSON to JSON

Back in the xsl(t) days.... if you did an "xml to xml" transformation, you could do a "copy *star dot *star" (copy everything "as is").. thing with an xsl template (probably) like the below.
granadaCoder
  • 26,328
  • 10
  • 113
  • 146
0
votes
1 answer

In Azure Logic apps, what is/are the advantage(s) of using a liquid template to convert xml?

In logic apps you can simply call json(xmlStringHere) to convert your xml to json, so not sure what do we need liquid template for.
Mocas
  • 1,403
  • 13
  • 20
0
votes
2 answers

FHIR Converter for Python

Is there is any function available in python to convert the given json input into HL7 FHIR format. By passing the Liquid Template (Shopify) and the input source data.
Akram
  • 958
  • 5
  • 11
0
votes
1 answer

How to Transform from xml to json in Azure Logic apps using Liquid with duplicated element not in array

How to get values from xml where objects are duplicated and names of these objects are the same: Here is sample XML true SE
Redduke
  • 27
  • 6
0
votes
1 answer

How to target multiple templates in liquid unless statement

{% unless template == "templatename1" and "templatename2" %} or {% if template == "templatename1" , "templatename2" %} I would like to target "templatename2" as well but In this code, only "templatename1" is working.
0
votes
1 answer

Azure policy - liquid template - convert milliseconds to formatted date

How can I convert milliseconds date to formatted date. I tried the following : { "date" : "{{ "1610924400000" | Date: "MM/dd/yyyy" }}" } But it…
anais1477
  • 466
  • 1
  • 17
  • 36
0
votes
1 answer

Save first word in SMS message using Twilio Studio

I'm working with Twilio Studio trying to get the first word from an SMS text message. The issue is that sometimes the word has a : or ; appended. Example: TEST: This is a test I need the TEST alone, without the :. I tried the truncatewords filter,…
SeaDude
  • 3,725
  • 6
  • 31
  • 68
0
votes
1 answer

How to find current url in any Shopify Liquid file (page.url and request.url not working)

We are injecting a modal in our site, which is being build using Shopify liquid templates. And we want to change the css of that modal according to the url change. I have tried window global object but it is not working as it involve server side…
0
votes
2 answers

How would I validate if my JSON object has another object or and Array, using Liquid Template

I am currently trying to find a way to validate if my JSON object has another object in it or an array while using liquid templates. I am using the xml-to-json policy which takes my below xml and turns it into JSON
0
votes
1 answer

Can I change the timezone for my api from the server where it is stored? Azure API Manager

I am using Azure API Manager with an api whose policy converts xml-to-json (done with a liquid template). One of the tasks I have is that I need to make sure that the dates in my JSON object are in a certain timezone. I have come across the…
0
votes
2 answers

How to append N zeros at the end of decimal number in Liquid?

I want to perform the following using Shopify liquid language: "1.322" -> "1.3220000" "1.3334" -> "1.3334000" "1.2" -> "1.2000000" "1.4444592" -> "1.4444592" I want exactly 7 digits after the decimal along with trailing zeros. All fields are…
0
votes
1 answer

How to assign a hashmap to a variable in Liquid Templates?

Is it possible to assign a Hashmap to a variable in this manner: {% assign translations = {en: 'Hello', es: 'Hola'} %} And then access it like this: {{ translations.en }} It seems possible from this question but accessing the translations variable…
Seif
  • 566
  • 2
  • 10
  • 21