Skip to content

Instantly share code, notes, and snippets.

@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
@enminc
enminc / modx.batchDeleteUnwantedUsers.php
Created October 2, 2013 06:16
simple modx api script to remove unwanted users
$dontRem = array('adam','admin'); /* add any additional context you dont wish to have removed here */
$users = $modx->getCollection('modUser');
foreach($users as $user){
$id = $user->get('id');
$name = $user->get('username');
if(!in_array($name,$dontRem)) {
$response = $modx->runProcessor('security/user/delete',array('id'=>$id));
if ($response->isError()) {
echo $response->getMessage() . '<hr/>';
@christianseel
christianseel / modxcloud nginx web rules
Last active March 31, 2016 20:32
# x-ua-xompatible # expire headers for assets # www.mydomain.com -> mydomain.com # filename-based cache busting # trailing slash redirect # statcache rewrite # modx furls rewrite
# x-ua-xompatible header
add_header X-UA-Compatible IE=edge,chrome=1;
#default charset uft-8
charset utf-8;
# allowed domains
set $rewrite_var 0;
@gadamiak
gadamiak / LangRouter.php
Created October 1, 2012 16:31
Language context router for use with Babel extra for MODX Revolution
<?php
/* LangRouter
* ==========
*
* This plugin is meant to be used with Babel extra for MODX Revolution. It
* takes care of switching contexts, which hold translations, depending on URL
* requested by client. LangRouter works with so called subfolder based setup,
* in which many languages are served under a single domain but are
* differentiated by a virtual subfolder indicating the language, eg.
* mydomain.com/pl/.