{"id":13790047,"url":"https://github.com/DNN-Connect/SkinControls","last_synced_at":"2025-05-12T07:31:21.848Z","repository":{"id":145428960,"uuid":"44770990","full_name":"DNN-Connect/SkinControls","owner":"DNN-Connect","description":"DNN Connect skin controls suite","archived":false,"fork":false,"pushed_at":"2018-09-11T09:37:26.000Z","size":46,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-18T04:35:36.619Z","etag":null,"topics":["dotnetnuke"],"latest_commit_sha":null,"homepage":null,"language":"C#","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/DNN-Connect.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-10-22T20:20:19.000Z","updated_at":"2018-10-19T02:03:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"f09fec3c-822e-4c1e-bdcf-4e8044fbcd75","html_url":"https://github.com/DNN-Connect/SkinControls","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNN-Connect%2FSkinControls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNN-Connect%2FSkinControls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNN-Connect%2FSkinControls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNN-Connect%2FSkinControls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DNN-Connect","download_url":"https://codeload.github.com/DNN-Connect/SkinControls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253695118,"owners_count":21948814,"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":["dotnetnuke"],"created_at":"2024-08-03T22:00:36.337Z","updated_at":"2025-05-12T07:31:21.363Z","avatar_url":"https://github.com/DNN-Connect.png","language":"C#","funding_links":[],"categories":["Awesome DNN (DotNetNuke) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Open Source Modules"],"readme":"# DNN Connect Skin Controls\n\nThis is a suite of controls that allow you to create some powerful functionality in a skin. \nCentral is the use of Razor files. These are loaded as a control into the ascx of your skin \nas follows:\n\n``` asp\n\u003cconnect:RazorWebControl runat=\"server\" id=\"ctlLogin\" ControlName=\"Login\" ControlPath=\"Skin\" /\u003e\n```\n\nThe ControlName can be either User or Login for now. These then set the property\nControlSource which points to the actual name of the file. If you choose Login then\nControlSource will be either LoginAuthenticated or LoginUnauthenticated. Similarly\nfor ControlName=\"User\" the ControlSource with be either UserAuthenticated or UserUnauthenticated.\nBut you can specify your own ControlSource directly of course. It's just that Login and User\nhave the ability to switch between the state of the user being authenticated or not.\n\nThe ControlPath tells it whether it will find the file in the system (DesktopModules) path \nor in the skin folder (under the folder \"Controls\"). The latter is the preferred method\nand keeps everything with the skin.\n\n``` csharp\nif (string.IsNullOrEmpty(ControlPath))\n{\n    ControlPath = \"/DesktopModules/Connect/SkinControls/Controls/\";\n}\nif (ControlPath.ToLower() == \"skin\")\n{\n    ControlPath = PortalSettings.ActiveTab.SkinPath + \"Controls/\";\n}\n```\n\nThe ControlSource eventually leads to the Razor file which is expected to be a cshtml.\n\n``` csharp\npublic RazorEngine Engine\n{\n    get { return _engine ?? (_engine = new RazorEngine(string.Format(\"~{0}{1}.cshtml\", ControlPath, ControlSource), Attributes, PortalSettings, LocalResourceFile)); }\n}\n```\n\nThe Razor files inherit from Connect.DNN.Modules.SkinControls.Razor.SkinControlWebPage. \nBesides the usual suspects Dnn, Html and Url this also includes a property Ctl which gives access\nto the encapsulating control. This way you can pass values through attributes to the Razor file\nlike this:\n\n``` asp\n  \u003cconnect:RazorWebControl runat=\"server\" id=\"ctlBreadCrumbs\" ControlName=\"BreadCrumbs\" ControlPath=\"Skin\" RootLevel=\"0\" /\u003e\n```\n\nAnd in the Razor file:\n\n``` csharp\n int intRootLevel = 0;\n if (Ctl.Item(\"RootLevel\") != null)\n {\n  Int32.TryParse(Ctl.Item(\"RootLevel\"), out intRootLevel);\n }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDNN-Connect%2FSkinControls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDNN-Connect%2FSkinControls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDNN-Connect%2FSkinControls/lists"}