• Resolved jedlin

    (@jedlin)


    Can I adjust the API URL used by the JSON Content Gutenberg block in response to variable passed in the containing page’s URL? Example use case:
    — a page at URL /states has a JSON Content Gutenberg block that calls an API to request a list of US state names (e.g. api.com/states/all)
    — the block displays each returned state name as a clickable link having URL like /cities?state=ca
    — JSON Content Gutenberg block on /cities page calls api with request for cities in the selected state (e.g. api.com/[state]/cities/all)
    In other words, would I need 50 pages with blocks having hard-coded API URLs, or can I have one page where the block’s API URL incorporates a passed variable?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author berkux

    (@berkux)

    Hi @jedlin,

    thank you for asking.

    The free JCI Plugin is not able to use GET- or POST-Parameters. Therefore the JCI Block just ignores state=ca

    Sorry about that,
    Bernhard

    Thread Starter jedlin

    (@jedlin)

    Thanks for your quick answer. Since you qualified your answer to the free version, I guess the implication is that the paid version might do what I want. So I’ll give that a try.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Include variable in JSON block’s API URL’ is closed to new replies.