2012-05-19, 09:03

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

2009-11-03, 08:40

On November 1, 2009, I bought and configured an additional domain for all web services (...) »

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
Show Donation/ Payment Page... Donate/ Pay
Worthwhile Services
Refresh My Local Time (GMT+1)... 2012-05-19, 09:03
  • Ukraine (1)
    United States (8)
  • Today (151)
  • Yesterday (386)
~ / 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, 12:32 — Size: 985,00 B — Users: 81 — Downloads: 111
Download This Attachment... SelfReference Snippet (with redirect parameter)
Last modified: 2010-01-20, 19:57 — Size: 1,21 KB — Users: 53 — Downloads: 78
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 moderator, who is a human rather than a wind-fast computer program so please be patient. Off-topic comments are definitely removed.

* Code:
 
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
Comment
Re: Self Reference Extended
Comment #1 on: 2010-01-04, 16:05
Hello,

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>

:)

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