I have a snippet, which controls what appears in a sidebar. The problem I’m having is that the snippet loads a call to Ditto in the sidebar, and when it does the page loads at the sidebar content instead of the top of the page. How can I force the page to open back at the top?
Thanks,
Hald
"Today’s headlines are nothing more than whispers of history"
you talking about frames or what? See www.w3schools.com
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Doze; No - no frames. The snippet calls some html based on the page id and for some reason the page opens centered on the returned Ditto summary items and the top of the page is out of sight. The content is displayed ok. If I comment out the call - the page opens normally with the top of the page showing. The snippet is called in the div where the content goes.
Snippet code as "ReplaceSidebar" is ;
<?php
$curPageNum = $modx->documentIdentifier;
switch($curPageNum){
case 1:
$output='<h4>Articles</h4> [[Ditto? &parents=`2` &summarize=`4` &tpl=`new-sidebar`&dateFormat=`%B %d, %Y` ]] ';
break;
}
return $output;
?>
and in the Template ;
<div id="content-extra">
<div id="search">
[!AjaxSearch? &AS_showForm=`1`!]
</div>
<div id="news_summary">
[[ReplaceSidebar]]
</div> <!-- end of news_summary -->
<div id="user_login">
<h4>Login:</h4>
<div id="sidebarlogin">[!WebLogin? &tpl=`FormLogin` &loginhomeid=`[(site_start)]`!]</div>
</div> <!-- end of user_login -->
</div> <!-- end of content-extra -->
The Ditto returns nicely and in the correct location - it just bumps the page down.
Any ideas?
HalD
"Today’s headlines are nothing more than whispers of history"
Doze; Problem solved. You know what it turned out to be? A "
" buried in the template I was using for Ditto!
Thanks,
HalD
"Today’s headlines are nothing more than whispers of history"