Issue:Dynamic offset to pages

From FollowTheScore
Jump to: navigation, search
Description: Can you add a dynamic page offset to your class?
Extension / Version: DPL   /   Latest
Type / Status: Change Request   /   closed

Problem

I have just started using DLP and like it a lot. However I do not like DLP example 13. I was wondering why you don't add this feature to your class. It should be fairly simple if you use the same method as the Category page.

If you first open the page

http://www.mywiki.com/wiki/MyDynamicPage You will get the offset specified by the <DPL>offset=0|count=100</DPL>, in this case is zero

Then if there are additional pages to show (query one more than you plan to display), you could add a link to the bottom to select the page http://www.mywiki.com/mediawiki/index.php?title=MyDynamicPage&doffset=100

This page knows its offset and can print forward and back links. This is how I grabbed the doffset in your class.

       $_sOffset = self::$options['offset']['default'];
       $iOffset  = ($_sOffset == ) ? 0: intval($_sOffset);
       global $wgRequest;
       $_doffset  = $wgRequest->getVal( 'doffset' );
       $iOffset = ($_sOffset == ) ? $iOffset: intval($_doffset);

Is this something you would consider adding?


Reply

You are right, the current solution is ugly. I will introduce a mechanism by which command line variables are translated to DPL built-in variables. Then you can write something like

         ../wiki/index.php?title=mypage&DPL_offset=200

and you can access the parameter value via

         offset=%DPL_offset%

within the DPL statement.

Apart from that I will look for a way to move the code for generation of forward and backward links to a separate template. I do not want to hard-code these links in php as they may be changed according to preferences and language of the wiki users.

Gero 12:04, 24 May 2009 (UTC)

Suggestion

Perhaps you could generate %DPL_offset_back% and %DPL_offset_fwd%. Those could be used in the template to create the links if they are needed.

Conclusion

A lot of work has gone into a new scrolling mechanism. So i close this issue. Gero 16:38, 1 July 2009 (UTC)