{"action":"created","issue":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/1433","repository_url":"https://api.github.com/repos/OrchardCMS/OrchardCore","labels_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/1433/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/1433/comments","events_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/1433/events","html_url":"https://github.com/OrchardCMS/OrchardCore/pull/1433","id":293764207,"number":1433,"title":"Add \"ViewLayout\" prop to liquid / razor page - Add \"layout\" liquid tag.","user":{"login":"jtkech","id":8586360,"avatar_url":"https://avatars1.githubusercontent.com/u/8586360?v=4","gravatar_id":"","url":"https://api.github.com/users/jtkech","html_url":"https://github.com/jtkech","followers_url":"https://api.github.com/users/jtkech/followers","following_url":"https://api.github.com/users/jtkech/following{/other_user}","gists_url":"https://api.github.com/users/jtkech/gists{/gist_id}","starred_url":"https://api.github.com/users/jtkech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtkech/subscriptions","organizations_url":"https://api.github.com/users/jtkech/orgs","repos_url":"https://api.github.com/users/jtkech/repos","events_url":"https://api.github.com/users/jtkech/events{/privacy}","received_events_url":"https://api.github.com/users/jtkech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2018-02-02T03:43:45Z","updated_at":"2018-02-26T21:58:30Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/pulls/1433","html_url":"https://github.com/OrchardCMS/OrchardCore/pull/1433","diff_url":"https://github.com/OrchardCMS/OrchardCore/pull/1433.diff","patch_url":"https://github.com/OrchardCMS/OrchardCore/pull/1433.patch"},"body":"Fixes #1425 \r\n\r\nThen, i could define a custom layout just by doing this in a liquid view.\r\n\r\n    {% no_render ThemeLayout | add_alternates: \"Layout2\" %}\r\n\r\n---\r\n\r\n@sebastienros just saw your comment on the related issue, so i will create a dedicated tag.\r\n\r\n> We need a tag for liquid. Like the standard layout tag in liquid.\r\n\r\nOkay\r\n\r\n> And a property in the base class that when assigned will insert an alternate at the top\r\n\r\nWhy? Through a tag we can already easily add an alternate to the `ThemeLayout` ambient value. And maybe in the future we would want to `clear_alternates` and `add_classes` ... So, maybe also good to still add `ThemeLayout` in the context local scope, and have a `no_render` tag (or another name).\r\n\r\n> We also need to ensure that this alternate is not actually preserved across requests, I am not really sure of it.\r\n\r\nAs i have tried, this is not the case.\r\n\r\n---\r\n\r\n**Update**\r\n\r\n- I also added shape `Wrappers` filters.\r\n\r\n- I added a `ViewLayout` property to our `RazorPage` class. Anyway, in razor views it will be easier to just do `ViewLayout = \"SomeLayout\"`. Didn't test it in a razor view, i will check it tomorrow.\r\n\r\n- Then, i wanted to use this property in the liquid tag, but currently our liquid page inherit from the mvc razor page, not from our custom one. Before it was the case but i changed it when we harmonized `Contextualize()` called from different contexts and began to pass the `DisplayContext` in place of the `LiquidPage`, and then resolve services ourself.\r\n\r\n- So here, the `LiquidPage` now inherits from our custom `RazorPage`. Then, because i can retrieve it from the `DisplayContext`, i set it in the ambient values and then set the new `ViewLayout` prop in the tag.\r\n\r\n- Note: See in the code, i kept both versions of the `layout` tag, one which use the new `ViewLayout` property and one which update directly `ThemeLayout.Metadata.Alternates`.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/comments/368665478","html_url":"https://github.com/OrchardCMS/OrchardCore/pull/1433#issuecomment-368665478","issue_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/1433","id":368665478,"user":{"login":"sebastienros","id":1165805,"avatar_url":"https://avatars0.githubusercontent.com/u/1165805?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastienros","html_url":"https://github.com/sebastienros","followers_url":"https://api.github.com/users/sebastienros/followers","following_url":"https://api.github.com/users/sebastienros/following{/other_user}","gists_url":"https://api.github.com/users/sebastienros/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastienros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastienros/subscriptions","organizations_url":"https://api.github.com/users/sebastienros/orgs","repos_url":"https://api.github.com/users/sebastienros/repos","events_url":"https://api.github.com/users/sebastienros/events{/privacy}","received_events_url":"https://api.github.com/users/sebastienros/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T21:58:30Z","updated_at":"2018-02-26T21:58:30Z","author_association":"OWNER","body":"We can use another PR for Query and Content. I want to solve the filter/tag issues here as I don't want to break it multiple times.\r\n\r\nLet's agree on immutable filters that would not change the shape but return a new one. I will go over it again with @jtkech."}}
{"actor":{"display_login":"sebastienros"}}