{"action":"created","issue":{"url":"https://api.github.com/repos/twigjs/twig.js/issues/583","repository_url":"https://api.github.com/repos/twigjs/twig.js","labels_url":"https://api.github.com/repos/twigjs/twig.js/issues/583/labels{/name}","comments_url":"https://api.github.com/repos/twigjs/twig.js/issues/583/comments","events_url":"https://api.github.com/repos/twigjs/twig.js/issues/583/events","html_url":"https://github.com/twigjs/twig.js/issues/583","id":355973403,"node_id":"MDU6SXNzdWUzNTU5NzM0MDM=","number":583,"title":"Is it possible to manipulate views with POST vars?","user":{"login":"langy","id":713141,"node_id":"MDQ6VXNlcjcxMzE0MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/713141?v=4","gravatar_id":"","url":"https://api.github.com/users/langy","html_url":"https://github.com/langy","followers_url":"https://api.github.com/users/langy/followers","following_url":"https://api.github.com/users/langy/following{/other_user}","gists_url":"https://api.github.com/users/langy/gists{/gist_id}","starred_url":"https://api.github.com/users/langy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/langy/subscriptions","organizations_url":"https://api.github.com/users/langy/orgs","repos_url":"https://api.github.com/users/langy/repos","events_url":"https://api.github.com/users/langy/events{/privacy}","received_events_url":"https://api.github.com/users/langy/received_events","type":"User","site_admin":false},"labels":[{"id":321865465,"node_id":"MDU6TGFiZWwzMjE4NjU0NjU=","url":"https://api.github.com/repos/twigjs/twig.js/labels/discussion","name":"discussion","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-31T13:07:34Z","updated_at":"2018-08-31T13:17:30Z","closed_at":null,"author_association":"NONE","body":"Long time user, first time poster. Less of an issue, more of a query. I've Googled and gotten nowhere, asked a maintainer, and decided to just ask here. Apologies if this isn't the place, but hey, it's a Friday, so maybe I'll be forgiven / given the time of day.\r\n\r\nI'd like to manipulate one of my views so that different data is shown based on what's POSTed from a form on a previous view. Does anyone know of a way to do this?\r\n\r\nPseudo code example:\r\n\r\n[view: colour_options.twig]\r\n```\r\n<form action=\"theme.html\">\r\n<fieldset>\r\n<label for=\"red\">\r\n<option name=\"colour\" value=\"red\" id=\"red\"> Red\r\n</label>\r\n<label for=\"yellow\">\r\n<option name=\"colour\" value=\"yellow\" id=\"yellow\"> Yellow\r\n</label>\r\n<label for=\"blue\">\r\n<option name=\"colour\" value=\"blue\" id=\"blue\"> Blue\r\n</label>\r\n</fieldset>\r\n<button>View theme</button>\r\n</form>\r\n```\r\n\r\n[view: theme.twig, rendered as theme.html?colour=red]\r\n```\r\n{% set theme_colour = POST.colour; %}\r\n<div style=\"background-color: {{ theme_colour }};\"></div>\r\n```\r\n\r\nAny advice on how to achieve this would be appreciated, even if it can't be achieved with Twig.js and requires another lib.\r\n\r\nMany thanks"},"comment":{"url":"https://api.github.com/repos/twigjs/twig.js/issues/comments/417660900","html_url":"https://github.com/twigjs/twig.js/issues/583#issuecomment-417660900","issue_url":"https://api.github.com/repos/twigjs/twig.js/issues/583","id":417660900,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzY2MDkwMA==","user":{"login":"langy","id":713141,"node_id":"MDQ6VXNlcjcxMzE0MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/713141?v=4","gravatar_id":"","url":"https://api.github.com/users/langy","html_url":"https://github.com/langy","followers_url":"https://api.github.com/users/langy/followers","following_url":"https://api.github.com/users/langy/following{/other_user}","gists_url":"https://api.github.com/users/langy/gists{/gist_id}","starred_url":"https://api.github.com/users/langy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/langy/subscriptions","organizations_url":"https://api.github.com/users/langy/orgs","repos_url":"https://api.github.com/users/langy/repos","events_url":"https://api.github.com/users/langy/events{/privacy}","received_events_url":"https://api.github.com/users/langy/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T13:17:30Z","updated_at":"2018-08-31T13:17:30Z","author_association":"NONE","body":"Well, the views are already rendered into html files before the POST happens... So no, I guess it's not used as a back-end. I'm just POSTing between static files. I just wondered if there was a way of being able to pass the potential POST options through into the next view, and then only show the relevant content based on the POST data."}}
{"actor":{"display_login":"langy"}}