Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / fixpath.snippet.php
Created May 6, 2014 10:17
Repair id2path if a resource is displayed in context of another resource. Uses either the current +id placeholder or a custom id added as output filter option.
<?php
/*
Repair id2path if a resource is displayed in context of another resource.
Uses either the current +id placeholder or a custom id added as output filter option.
Example for getResources:
[[+ImageTv:fixPath]]
Example for fastfield:
<?php
/**
* MODX Revolution OnElementNotFound plugin
* Add static elements inside categories for defined packages OnElementNotFound
*
* Author: Jeroen Kenters / www.kenters.com
* Version: 1.0.0-beta
* License: GPL
*
* Warning:
@pepebe
pepebe / mgThumb.plugin.php
Last active August 29, 2015 14:01 — forked from christianseel/moregallery img to TV
Add this as a plugin (OnDocFormSave). Saves the first MoreGallery image or cropimage into a TV (could be a hidden one) for quicker access.
<?php
/*
mgThumb by pepebe
---------------------------------------------
saves the first image in a galley inside a tv
trigger OnDocFormSave
Initial idea: https://gist.github.com/christianseel/557a1e0f2a1f502ce1c5
Changelog:
@pepebe
pepebe / ppb_seoProCss.plugin.php
Created May 24, 2014 20:45
Alternative layout for sterc seoPro
<?php
/*
ppb_seoProCss
Alternative layout for sterc seoPro
AUTHOR:
info@pepebe.de
USAGE:
@pepebe
pepebe / ppb_inArray.snippet.php
Created May 26, 2014 18:05
Find out if there are resources where the ID of the current resource can be found inside TV with comma separeated values.
<?php
/*
DESCRIPTION:
------------
Find out if there are resources where the ID of the current resource
can be found inside TV with comma separeated values.
Usefull for teaching getResources a new trick.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@pepebe
pepebe / a2z.snippet.php
Last active August 29, 2015 14:02
a2z - refurbished siteAtoZ snippet
<?php
/**
* a2z snippet
* @author pepebe info@pepebe.de
* @version 0.0.1
* 06/17/2014
*
* Refurbished version of siteAtoZ snippet by bobray.
*
* Usage:
@pepebe
pepebe / inherit_parent_resourcegroups.php
Created August 12, 2014 07:05
Inherit parent resource group.
/*
Inherit resource groups only if resource is new
Source: http://forums.modx.com/thread/79531/inheriting-resource-groups
Author: paulmerchant (http://forums.modx.com/u/paulmerchant)
Compatible 2.2.x
Not tested with 2.3.x (might even not be necessary anymore in 2.3.x ...)
*/
@pepebe
pepebe / plugin.php
Created August 20, 2014 22:33 — forked from Mark-H/plugin.php
<?php
if ($modx->getOption('http_host') == 'YOUR_DOMAIN_HERE') {
$op = '<script type="text/javascript">
Ext.onReady(function() {
document.getElementById("modx-login-username").value = "USER";
document.getElementById("modx-login-password").value = "PASS";
document.getElementById("modx-login-btn").click();
});
</script>';
@pepebe
pepebe / VimeoAlbum.php
Last active August 29, 2015 14:06
MODX Snippets for Vimeo Intergration
<?php
/*
VimeoAlbum will pull in an album from Vimeo, complete with links, thumbnails, descriptions, etc.
Source: http://forums.modx.com/thread/13967/solved-snippets-for-integrating-vimeo#dis-post-76815
Author: http://forums.modx.com/u/danzg
CAVEAT: This will only return the first 20 videos in a given album,
and will not return any videos whose privacy is hidden!
[[VimeoAlbum?albumID=`VimeoAlbumID`]]