+ Reply to Thread
Results 1 to 7 of 7

Thread: Permalink: http://tinyurl.com/55uj8n

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Roseville, California USA
    Posts
    173

    Default Permalink: http://tinyurl.com/55uj8n

    I've noticed that on the wiki.developer.mindtouch.com website that there is a small link in the upper right hand corner of pages which lists a tinyurl for that page. For example:

    Permalink: http://tinyurl.com/55uj8n

    This is a nice feature which offers a quick shortened link for that page.

    Is this an extension for MindTouch Deki? How is this link generated and inserted?
    Aurora

    Questions relate to Deki server:
    OS: Ubuntu 10.04
    MindTouch v10 version 10.0.1 Non-VM

  2. #2
    Join Date
    Feb 2007
    Posts
    1,871

    Default

    It's executed using DekiScript; you can see the source at: http://wiki.developer.mindtouch.com/...mplate:TinyUrl

    We then used global templates to include it on every page.

  3. #3
    Join Date
    Jul 2007
    Posts
    347

    Default

    This is the php version for e.g. Ace.php:

    Code:
    <div class="tinyurl">
    	Permalink: 
    	<?php $tinyUrl = file_get_contents("http://tinyurl.com/api-create.php?url=" . $wgTitle->getFullURL() ); ?>
    	<a href="<?php echo($tinyUrl); ?>" rel="custom"><?php echo($tinyUrl); ?></a>
    </div>
    Format the class tinyurl to your liking (color, position, etc.). E.g. we are using this for our customized version of the Ace skin in common.css:
    Code:
    div.tinyurl {
    	float: right;
    	color: #CDD2DE;
    	font-size: 10px;
    	padding: 8px 12px;
    }
    div.tinyurl a {
    	color: #CDD2DE !important;
    	text-decoration: none;
    }
    Last edited by merktnichts; 08-15-2008 at 10:41 PM. Reason: added some css examples

  4. #4
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    I've also created a sample DekIScript page for it:
    http://wiki.developer.mindtouch.com/...tomatically%3F
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  5. #5
    Join Date
    Mar 2008
    Location
    Sydney
    Posts
    106

    Default

    I'd really like to implement this on our Deki, it would be a great feature.

    Thanks for the code, it works well when I add it to a page. However, I don't know how to add it to a global template so that it appears on every page. The code from merktnichts above is for a particular skin, but could it go in a more generic location?

    If anyone could advise where to add the code so it gets included in every page that would be great.

  6. #6
    Join Date
    Jul 2007
    Posts
    347

    Default

    scop, you should be able to put the snippet I posted in august into every skin you like.
    You'll be doing the formatting using css anyway, so just open the php file for the skin of your liking and paste the php snippet to a suitable place. As you're gonna see the results immediately, it shouldn't be a hard job.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts