Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Tutorial: add "Copy Article To Clipboard" to your articles

 

 


MEKAEEL
User

Dec 4, 2006, 9:00 PM

Post #1 of 2 (1060 views)
Shortcut
Tutorial: add "Copy Article To Clipboard" to your articles Can't Post

Hello guys,

This is a tutorial of how to make a "Copy Article To Clipboard" link in your articles so users can copy the text and paste it somewhere else neatly with the author, link, and title. This may seem silly but it's a nice addition really if you see the result. You'll get something like this copied when the link is clicked:


Quote
-------------------------
Title: Article Title
Author: mekaeel
Link: Link to Article
-------------------------
This is the article's text!



I didn't write this code really, all I did was implementing it in AM. Anyway here is what you need to do:



1- In your articlePage template file add this in the HEAD section:

Code
      <SCRIPT LANGUAGE="JavaScript">  function ClipBoard() { Copied = holdtext.createTextRange(); Copied.execCommand("Copy"); alert("Article Copied!"); }</SCRIPT>




2- Down in the body section you need to put this too, you can put it anywhere really since it will be hidden:


Code
   <TEXTAREA ID="holdtext" STYLE="display:none;"> -------------------------   
Title: $article.title$
Author: $article.art_field1$
Link: $published.articlePage.url$
-------------------------
$article.content$

-------------------------
</TEXTAREA>




This will add a hidden text area which will contain your article's information.



3- Add the copy link. This is it:


Code
      <a href="javascript:ClipBoard();" style="text-decoration: none">Copy The Article</a>

See where you like to put it and just add it Smile then don't forget to publish your article pages.

I hope it works well for you, I only tried it quickly so please feel free to ask or add anything you want.

best wishes,
mekaeel


(This post was edited by MEKAEEL on Dec 5, 2006, 7:51 PM)


ChetW
Staff


Dec 6, 2006, 1:37 PM

Post #2 of 2 (1036 views)
Shortcut
Re: [MEKAEEL] Tutorial: add "Copy Article To Clipboard" to your articles [In reply to] Can't Post

Hi Mekaeel,

Thanks for the post!

This sounds like a good tutorial that people in the community should find useful. :)
Cheers,
Chet Woodside - Product Specialist
support@interactivetools.com

[hr][i][url "http://www.interactivetools.com/consulting/"][b]Hire me![/b][/url]
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with [url "http://www.interactivetools.com/consulting/"][b]Priority Consulting[/b][/url].[/i]