Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Yes, this feature is hidden deep in the documentation: Advanced -> Pass -> Query variables.

    [pass global=query fields=name,city]
      Hello {NAME}. You live in {CITY}.
    [/pass]
    Thread Starter ploughansen

    (@ploughansen)

    Thanks, this works.

    Related question: One of the values in the querystring is a date and a time in unix format (ex. ‘20160128’ and ‘1201’). Can your plugin format these values into something more readable (like 2016/01/28 or 28-01-2016) (and time like 12:01)?

    Also, another value is amount as integer value. So 1,234.56 is written as 123456. Can your plugin perform basic calculation? That way I could divide by 100 and get the correct value.
    It would be really nice if the value could be formatted as a number with a fixed decimal.

    Plugin Author Eliot Akira

    (@miyarakira)

    Currently the plugin doesn’t have a way to format dates/numbers from query strings, or do calculations. Especially calculations would be hard to achieve with shortcodes, it’d be simpler done with PHP.

    That said, your questions gave me some ideas, so I’ll see if it’s possible. I’ll post here if/when the feature is included.

    Plugin Author Eliot Akira

    (@miyarakira)

    In the newest plugin update, I added a feature to format dates and numbers, as well as an optional module to do calculations.

    To format a value like 20160128 into 2016/01/28

    [format date=Y/m/d] {DATE} [/format]

    To format a value like 1201 into 12:01

    [format date=H:i] {TIME} [/format]

    To format a number with 2 decimal places

    [format decimals=2] {NUMBER} [/format]

    To do a calculation, the optional Math module must be enabled in Settings. The result can then be formatted.

    [format decimals=2] [calc] {NUMBER} / 100 [/calc] [/format]
    Thread Starter ploughansen

    (@ploughansen)

    That’s amazing. I can’t wait to try this.

    Will let you know how it works!

    Thanks 🙂

    Plugin Author Eliot Akira

    (@miyarakira)

    There is documentation about [format] in Advanced -> Extras, and about [calc] in Optional -> Math.

    At first, I was hesitant to include a calculation feature, because I’m trying to keep the plugin compact and focused. But I found a light-weight and safe math module, and I figured if it’s optional, people can enable it only when needed. It looks like it could be pretty useful, to calculate things based on field values.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Getting parameters from query-string’ is closed to new replies.