Skip to content

Instantly share code, notes, and snippets.

View plompd's full-sized avatar
🏠
Working from home

Daniel Plomp plompd

🏠
Working from home
View GitHub Profile
// pages/index.js
export async function getStaticProps() {
const res = await fetch('https://your-sitefinity-instance/api/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
query: `
{
newsItems {
title
# Ploi Worker
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwJdAxi+PE7Cyk/Sl2tPUfVxs4GKZ+nwh4LSy9QEkjcykiXOBLqa4TjS+Ougzi6gJGMUSZlyIVJsfO3aYoCoSZ6kdb7+2DCAKUiip/8O5AZoVjcoAvm5SSVhEQlBWcJzdSnQbpxJzIG2EB4hIxn2TV6TLUHGEqr1Zp8MJKIx8c3n+IZVmrIfKk05653DMCqNdC4zXc2jFvXOwJMUIg6d6wiKyf910PWOJcC01LBRuzEgn+/R1RZHzrjM2Rff1EM2r6U4CUzz3uYFWSLugi/0aSSzMwOnIi2YJHS2vyf3stWBBD8mRO6WRMpeVynP1hkz5S2bdGAmDM5cfUBVpzg1s3 ploi-worker@ploi.io
@plompd
plompd / share-urls-social-networks.md
Created June 30, 2021 09:53
Share URLs for Facebook, Twitter, LinkedIn, Pinterest and Weibo

Create share buttons or links with URLs

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=<URL>&p[title]=<TITLE>

bundles.Add(new DynamicFolderBundle("scripts", "*.js", true, new JsMinify()));
public class CustomPageTemplateExtender : PageTemplateExtender
{
public override void ExtendTemplate(Dynamicweb.Rendering.Template template)
{
var scriptBundle = Scripts.Render("~/bundles/plugins").ToHtmlString();
template.SetTag("FooterScripts", scriptBundle);
}
}
public void Application_Start(object sender, EventArgs e)
{
// Register our bundle collections
BundleConfig.RegisterBundles(BundleTable.Bundles);
// Fires when the application is started
Dynamicweb.Frontend.GlobalAsaxHandler.Application_Start(sender, e);
}
/// <summary>
/// Register the bundles into the bundle collection on startup
/// </summary>
/// <param name="bundles"></param>
public static void RegisterBundles(BundleCollection bundles) {
// Create a bundle that includes all script files
bundles.Add(new ScriptBundle("~/bundles/plugins").Include(
"~/Files/Templates/Designs/HelloTreble/assets/js/plugins/source/jquery.bxslider.js",
"~/Files/Templates/Designs/HelloTreble/assets/js/plugins/source/jquery.centralized.js",
"~/Files/Templates/Designs/HelloTreble/assets/js/plugins/source/jquery.fixedonlater.js",
---
title: Protected Page
protect: logged_in
---
My protected page
protected void Application_Start(object sender, EventArgs e) {
Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
}
private void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e) {
SystemManager.RegisterWebService(typeof(SortableUsers), "Sitefinity/Services/Security/Users.svc");
}
public class SortableUsers : IUsers
{
private IUsers baseService;
public IUsers BaseService
{
get
{
if (baseService == null)
{