Created
April 10, 2015 13:17
-
-
Save Finetuned/840eafd9907008c4b4e3 to your computer and use it in GitHub Desktop.
MODX Plugin: Named Anchor with Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $modx->resource->get('id') !=$modx->config['site_start'] ) { | |
$params = ''; | |
if (count($_GET) > 1 ){ | |
$arr = $_GET; | |
array_shift($arr); | |
$params = '?'. urldecode(http_build_query($arr, "\n")); | |
} | |
$url = $modx->makeUrl($modx->resource->get('id')) . $params . '#'; | |
$modx->resource->_output = str_replace('href="#','href="' .$url ,$modx->resource->_output); | |
unset($arr); | |
unset($params); | |
unset($url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment