Skip to content

Instantly share code, notes, and snippets.

View jeremy-farrance's full-sized avatar

Jeremy Farrance jeremy-farrance

View GitHub Profile
@jeremy-farrance
jeremy-farrance / MyDDRMenu.cs
Last active June 4, 2022 01:48
DNN (DotNetNuke) Class to build DDRMenu Nodes for use Outside of DDRMenu Templates
// lazy usage, put this file in /App_Code in your DNN instance
// the benefit of dropping this as a .cs file in /App_Code is that it
// is now available THROUGHOUT DNN. You can use it in 2sxc VIews, RazorHost,
// theme (skins/containers), etc - wherever
// the benefits of doing this over working with Tabs/TabController are many; you get permissions
// applied and all the fields (properties) you need for doing navigation links (menus), you can
// pass in settings (include or exclude nodes), etc.
@david-poindexter
david-poindexter / _template.cshtml
Created October 30, 2021 23:09
2sxc: Pull data from another REST API
@inherits ToSic.Sxc.Dnn.RazorComponent
@using System.Net.Http;
@{
var client = new HttpClient();
HttpResponseMessage response = client.GetAsync("<API_URL>").Result;
response.EnsureSuccessStatusCode();
var result = response.Content.ReadAsStringAsync().Result;
var items = AsDynamic(result);
}
@jeremy-farrance
jeremy-farrance / _contenttype__List--basic.cshtml
Last active February 15, 2021 18:23
Effective and functional Load More button with no jQuery
@* 20210212 JRF
Load More reference pieces; there are many other ways to do this, and this leaves a lot open for enhancement.
This is not a working example, just the pieces *for reference*
Note 1a: this still sends ALL entries to the client, so this is not appropriate for more than 200 to 300 items IMHO
Note 1b: and if your output includes images, this would be BAD for slow connections and mobile
Note 2: this assumes Bootstrap 4.x is in place
The original was this using jQuery, at the time I was learning NOT to use jQuery
and this was an early attempt at doing something JS only.
@jeremy-farrance
jeremy-farrance / __debug.ascx
Last active August 8, 2021 18:04
A DNN Theme footer include file that outputs useful Debug info for OHS, development, etc. C#, CSharp, .NET
<%-- THIS IS THE C# CSharp .NET VERSION
NOTES:
- the way we get the Skin name is "janky" ;)
- uses Bootstrap (next version won't?)
How to use:
1. Save this file in your theme folder, usually includes/__debug.ascx
2. Update the IPs; add the WAN IP(s) for your location(s)
3. Update the Bootstrap version manually
4. Either in includes/_footer.ascx (or Home.ascx), before closing DIV in main <footer> section add this
@jeremy-farrance
jeremy-farrance / sftp.json
Last active September 13, 2020 00:19
VS Code sftp.json for liximomo's vscode-sftp extension for DNN (DotNetNuke) front-end editing
{
"host": "___HOST_NAME___",
"username": "___USER_NAME___",
"password": "___PASSWORD___",
"name": "AccuTheme",
"context": "./app",
"protocol": "ftp",
"port": 21,
"secure": true,
"secureOptions": {