Skip to content

Instantly share code, notes, and snippets.

View sepiariver's full-sized avatar

YJ Tso sepiariver

View GitHub Profile
@Jako
Jako / cbGetLayoutSettings.snippet.php
Last active August 20, 2021 08:46
Get a templated list of ContentBlocks layout settings
<?php
/**
* Use the cbGetLayoutSettings snippet to get a templated list of settings from a particular layout.
* Based on cbGetLayoutSetting snippet https://gist.github.com/sepiariver/302ab3cc7bd47233f0136f4379de89cf
*
* @param (id) &resource allows checking for fields on other resources.
* @param (bool) &showDebug return debugging info as JSON.
* @param (string) &toPlaceholder set a placeholder with this string as key, instead of returning.
* @param (int) &layout - (required) ID of ContentBlocks layout from which to fetch the settings.
* @param (string) &tpl - name of chunk for templating the settings of one layout.
@nbremer
nbremer / .block
Last active March 23, 2024 21:03
Radar Chart Redesign
height: 600
license: mit
@Mark-H
Mark-H / a readme.md
Last active November 24, 2022 13:16
modCli; using MODX on the commandline.

modCLI

modCLI is a wrapper for the MODX Revolution Processors, allowing you to pretty much do anything from the commandline that you would normally do within the manager.

To use modCLI, simply download the modcli.php file and put it in the MODX_BASE_PATH of your installation. Next open up the console or terminal, and start firing some commands at it.

Syntax

@avoronkin
avoronkin / specificTV.php
Created February 15, 2011 16:53
return all resources with a specific TV value
<?php
$c = $modx->newQuery('modResource');
$c->innerJoin('modTemplateVarResource','TemplateVarResources');
$c->innerJoin('modTemplateVar','TemplateVar','TemplateVarResources.tmplvarid = TemplateVar.id');
$c->where(array(
'TemplateVar.name' => 'access_front',
'TemplateVarResources.value' => true,
));
$ress = $modx->getCollection('modResource',$c);