Opposite function of jsonify

Quick question: is there a function runs as opposite of jsonify function that can parse template/html, template/text, or string data type?

Reason for asking:

  1. Able to pass structural data between partials (2 ways instead of 1 way) for building complex short-code functions.
  2. getJSON or getCSV does not make any sense because I’m not parsing it from a fixed data file, or a data source.

E.g.

1. shortcode A ---pass $data--> partial function A.1
2. partial function A.1 --process $data--> $outputA1 --jsonify--> $outputA1JSON --return--> shortcode A
3. shortcode A ---"reverse jsonify" $outputA1JSON--> $outputA1 --> parse for processing
4. continue shortcodeA operation

NOTE: $outputA1 is a structured data, not conventional single value (e.g. string, int, etc).

Use cases:

  1. Developing theme module functions to abstract all repetitive executions.
  2. Prevent a single partial file from getting overly bloated.

Found my answer:

The return partial value has to be converted to string type before passing into transform.Unmarshal. Works on multiple format including JSON.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.