{"id":16528720,"url":"https://github.com/zetlen/alternative-view","last_synced_at":"2025-08-09T06:23:39.156Z","repository":{"id":35317831,"uuid":"39579444","full_name":"zetlen/alternative-view","owner":"zetlen","description":"Declarative logic-driven template selection for Mozu storefronts.","archived":false,"fork":false,"pushed_at":"2015-08-14T20:07:37.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-16T10:10:14.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zetlen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-23T16:48:44.000Z","updated_at":"2015-07-23T16:49:01.000Z","dependencies_parsed_at":"2022-09-17T06:21:54.912Z","dependency_job_id":null,"html_url":"https://github.com/zetlen/alternative-view","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetlen%2Falternative-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetlen%2Falternative-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetlen%2Falternative-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetlen%2Falternative-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zetlen","download_url":"https://codeload.github.com/zetlen/alternative-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241618163,"owners_count":19991809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T17:41:20.090Z","updated_at":"2025-03-03T06:24:44.041Z","avatar_url":"https://github.com/zetlen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alternative-view\n### version 0.1.0\n\nDeclarative logic-driven template selection for Mozu storefronts\n\nhttp://www.infinitelooper.com/?v=6_9blTxwFeA\u0026p=n#/110;123\n\n\n## An alternative view?\n\nMozu Themes are incredibly powerful, but there are just a couple of places where you might wish they had more power than they do. For instance, in your `theme.json` file, you declare `pageTypes` that bind a type of storefront page to a particular Hypr template:\n\n```json\n        {\n            \"documentType\": \"web_page\",\n            \"entityType\": \"webpage\",\n            \"id\": \"home\",\n            \"template\": \"home\",\n            \"title\": \"Home Page\",\n            \"userCreatable\": true\n        },\n```\n\nThis declares that webpages assigned the \"home\" template must use a template in the theme called `templates/pages/home.hypr`. (The `\"template\"` configuration option expects the name of a file in that particular directory.)\n\nIn SiteBuilder, a merchant can assign web pages (or product pages, or category pages!) to alternate templates one by one, by changing their Page Settings.\n\nBut what if you want to do this dynamically?\n\n### AlternativeView can change the Hypr template a page uses based on rules.\n\nInstall AlternativeView, and then add rules to your Action Configuration. Want to change the template of a category page if a URL query parameter `alternate` is set to `true`? Add a template called `category–alternate.hypr` to the `templates/pages` folder of your theme, and then add the following rule to your `configuration` in Action Configurations:\n\n```json\n\"rules\": [{\n  \"type\": \"queryparams\",\n  \"params\": {\n    \"alternate\": true\n  },\n  \"viewName\": \"category-alternate\"\n}]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzetlen%2Falternative-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzetlen%2Falternative-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzetlen%2Falternative-view/lists"}