Answer the question
In order to leave comments, you need to log in
ModxRevo, how to make #anchor work on a website page?
There is a project of a not quite standard layout, the entire layout is crammed with anchors of the form.
Accordingly, the page url looks like siteurl.by/#main
, these same anchors are on all pages, and therefore, when trying to refresh the page, it always redirects to the main one, because the url has a # symbol
on On the documentation page, I found a plugin that should fix this problem. But it doesn't work here is his code<a href="#main">Ссылка</a>
<?php
if($modx->resource->get('id') !=$modx->config['site_start']) {
$modx->resource->_output =str_replace('href="#','href="' .$modx->makeUrl($modx->resource->get('id')) .'#',$modx->resource->_output);
}
<base href="http://askmeplz.com/" />
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question