Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / ppb_managerBreadCrumbs.plugin.php
Last active Aug 29, 2015
The plugin adds a breadcrumb navigation below the pagetitle for easier navigation/orientation.
View ppb_managerBreadCrumbs.plugin.php
<?php
/*
ppb_managerBreadCrumbs for modx 2.3.x
Version: 0.1
original plugincode written by @argnisto
frankensteined by info@pepebe.
Description: The plugin adds a breadcrumb navigation below the pagetitle
for easier navigation/orientation.
@tiff
tiff / protonet_rest_api_examples.md
Last active Aug 29, 2015
Protonet REST API Examples
View protonet_rest_api_examples.md

Protonet Rest API

All examples in this document are done via curl. You can however use any programming language to access the API. The API expects JSON and responds with JSON.

Authorization

The Protonet REST-API supports two authorization mechanisms:

  1. Basic authorization: Send email and password as base64 encoded string within the request headers
@hdragomir
hdragomir / sm-annotated.html
Last active Aug 9, 2022
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
View sm-annotated.html
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@m-engel
m-engel / MODX ResourceTree Onlysort.php
Last active Mar 3, 2017
Disable Drag&Drop Resources out of Containers
View MODX ResourceTree Onlysort.php
// Event: OnManagerPageBeforeRender
$script = "<script>
var ResourceTreeHandleDrop = MODx.tree.Resource.prototype._handleDrop;
Ext.override(MODx.tree.Resource, {
_handleDrop:function(e){
var dropNode = e.dropNode;
var targetParent = e.target;
if(dropNode.getDepth() != targetParent.getDepth() || (e.point == 'append')) return false;
if(dropNode.parentNode.id != targetParent.parentNode.id) return false;
@mkay
mkay / update-modx.sh
Created Mar 8, 2014
MODX CLI updater
View update-modx.sh
#!/bin/bash
########################################################
#
# MODX (modx.com) CLI updater
# Kreuder 20140308 mk@s1.gl
#
########################################################
#
# Description: perform a MODX Basic Upgrade via CLI.
#
@christianhanvey
christianhanvey / modx-snippets.php
Last active Mar 10, 2022
Useful snippets for MODX Revo
View modx-snippets.php
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@splittingred
splittingred / .htaccess
Created Apr 9, 2012
Example of how to use new REST server class in MODX 2.3+
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L]
</IfModule>