I’m not having any success with this. In fact, I’m have a strange scenario.
The links are being built <a href="[~1~]#anchor">Link</a>. When you click on "link" the anchor becomes the top of the page, and you can’t scroll up, basically chopping off the top half of the page (or anything above the anchor).
Am I missing something in the implementation of this plug-in? I copied:
$e= & $modx->Event;
switch ($e->name) {
case "OnWebPagePrerender" :
if($modx->documentIdentifier != $modx->config[’site_start’]) {
$modx->documentOutput= str_replace(’href="#’, ’href="’ . $_SERVER[’REQUEST_URI’] . ’#’, $modx->documentOutput);
}
break;
}
Into a new plug-in I called AnchorsAway, and checked OnWebPagePrerender.
What am I missing?