2018-04-27, 08:20

Feb 27, 2012 — Notify Users module, ver. 0.5 released — user can choose between sending single message (...) »

2013-01-28, 08:32

19 студзеня 2013 у Гродне трагічна загінуў паэт, журналіст і мой сябар (...) »

2009-10-14, 07:19

The site Litaratura.org is devoted to Belarusian literary works and translations. (...) »

2009-01-12, 20:46

Late November 2008 marked the 20th anniversary of the official founding of the Belarusian (...) »

Registered User Area Log into This Site
Show Credits... Credits
Worthwhile Services
Refresh My Local Time (GMT+1)... Apr 27, 2018 — 08:20
  • Russian Federation (1)
    United States (5)
  • Today (101)
  • Yesterday (451)
~ / Public Domain Software / Self Reference Extended $_
Self Reference Extended
Click To View A Full Size Image...
2009-11-07, 08:13

Scrolling a page from its bottom to a top is funny simple for achieving with the means given by MODx — you need to create anchor at the top and link it at the bottom (usually in footer section):

Simple "top of page" Link

<a name="topofpage"></a>
... main part of the page ...
<a href="[~[*id*]~]#topofpage">top of page</a>

The above code works fine for all typical cases but it is insufficient on sophisticated pages whose urls comprise one or more query variables — after clicking on such „top of page” link all query variables are lost and you are landing on the base/first page of the whole set of pages determined by those variables.

Scenario for generalized "top of page" Link

<a href="[(site_url)][!SelfReference!]#topofpage">top of page</a>

This generalized scenario works on this site, so I do not need to create special example in order to present how the snippet behaves ;) The snippet has been also posted to this thread on MODx forum.

The second attached version has been slightly modified — it still preserves all query variables of the currently active page, but allows you to specify &redir parameter and send a user to another page.

Download This Attachment... SelfReference Snippet — the very latest version
Last modified: 2010-01-09, 00:00 — Size: 985,00 B — Users: 195 — Downloads: 391
Download This Attachment... SelfReference Snippet (with redirect parameter)
Last modified: 2010-01-20, 00:00 — Size: 1,21 KB — Users: 165 — Downloads: 358
Click to show a form...Click to hide the form... Write a comment
  • Required fields are marked with *.
  • Comments are published after the approval of the site owner, who is a human rather than a wind-fast computer program so please be patient.

* Code:
Get another image...Enter this code into the appropriate field of the form while submitting an e-mail or a comment. If you have trouble with reading it, generate another...
Kristalin Chavdarov
Re: Self Reference Extended
Comment #1 on: 2010-01-04, 16:05

this is good idea!
I just added one little line:

<a href="#topofpage" onclick="if($.browser.opera){$('html').animate({scrollTop: $('#topofpage').offset().top}, 3000);} else $('html,body').animate({scrollTop: $('#topofpage').offset().top}, 3000);">^top</a>


Comment #2 on: 2011-05-24, 16:56
thankyou so much :)