<ul class="hide"> <li><a href="#start">skip to content</a></li> <li><a href="#navi">skip to navigation</a></li> </ul>
I have been trying to get this to work on my site in my ditto template, making the replix comment count a link to the comments on the article page.
That’s because every page is really "index.php?id=xx" where the xx is the document ID. So a # will indeed end up at the first page, since you’re basically linking to the default index.php.
I think you can use "a href="[~id~]#whatever" to get this to work. I’ve never tried it, so can’t make any guarantees.
<div class="dittoSummary">
<div class="dittoHead">
<h3><a href="[~[+id+]~]">[+title+]</a></h3>
[color=limegreen]<div class="commentCount">[color=red]<a href="[~[+id+]~]#pageCommens">[/color][[Replix? &mode=`comments.count` &docid=`[+id+]`]] comments on this story.</a></div>[/color]
</div>
<div class="dittoContent">
<p>[+summary+] [+link+]</p>
</div>
<div class="dittoAuthor"><p>by <strong>[+author+]</strong> on [+date+]</p></div>
</div><h2><a href="[~[+id+]~]">[*longtitle*]</a></2>
At least at my test-page.
@Scotty,
Did you notice that you have a typo in your Ditto template (#pageCommens)

<a href="[~[+id+]~]#anchorname">link to anchor</a>

I’ve tried the id-idea (thanks to sottwell and ScottyDelicious) - unfortunatly it seems not to work.
Hi Maszo,
it had already been covered there back in january :
http://modxcms.com/forums/index.php/topic,2455.0.html
and it works, I have several website running this
Quote from: Mazso at Sep 24, 2006, 09:02 AMI’ve tried the id-idea (thanks to sottwell and ScottyDelicious) - unfortunatly it seems not to work.
Are you running Friendly URLs ?
[~[+id+]~]
[~[*id*]~]

###########################################
# pageAnchor snippet for MODx by scotty Delicious
###########################################
$thisID = $modx->getDocumentIdentifier('alias');
$thisAnchor = (isset($anchor)) ? $anchor : "anchor";
$thisLink = (isset($linkText)) ? $linkText : "Click Here";
return '<a href="[(site_url)]'.$thisID.'#'.$thisAnchor.'">'.$thisLink.'</a>';
[!pageAnchor? &anchor=`anchorname` & linkText=`text (or <img>tag) to display for link`!]