Copy link to clipboard
Copied
On Peter Grainge's site, snippet 38 gives the code for e-mailing a link to a topic.
Before I go off in the wrong direction, is there any reason why I wouldn't be able to modify the code to capture the topic URL in the Subject line rather than in the body?
My intention is to create a "Feedback" button on the skin toolbar that would generate an e-mail to the Help content authors. In the body of the e-mail I would have the text "Please type your feedback here."
Copy link to clipboard
Copied
With anything like this the answer is to create a small test project with just a few topics and see what happens. If it messes up, no harm done to your project.
One thing I would be checking is whether the link is clickable in the subject line. If it is not, it means the recipient has got to cut and paste it into a browser rather than just click it.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Thanks Peter. In this scenario, the recipient will be the content author, so there will probably seldom be a need to open the topic from the server. The topic name will tell the content author where to go in the project source to find whatever it is that the feedback pertains to.
Copy link to clipboard
Copied
So far I have not been able to make this work. Using the skin editor, I am trying to paste the Mailto code into the "On click" property for a button. I've got it working when the topic URL is to be displayed in the body, but not when the same code is inserted into the Subject.
Has anyone seen a worked example I could steal learn from?
Here's the working version of the "On click" action with the topic URL captured in the body --
How would this be modified to capture the topic URL in the Subject line?
Copy link to clipboard
Copied
Hi,
See my Toolbar scripts: http://www.wvanweelden.eu/robohelp/toolbarscripts
Replace line 59 with: window.location = "mailto:&subject="+title+" "+escape(url)+"&body="+message+"\n"+title+": "+escape(url);
That should work the way you want.
Greet,
Willam
Copy link to clipboard
Copied
Is it possible to do the same thing using an in-line script rather than a stored file?
BTW, IE crashes when I open your Web page and click the script.
Copy link to clipboard
Copied
Hi,
Try this direct link: http://www.wvanweelden.eu/sites/default/files/download_page/toolbarscripts.js.txt
What exactly do you mean by inline script? You can take the JavaScript out of the script file and paste it in the Inline JavaScript popup under the toolbar action. I would not advise you to add the script as a single onClick event to the button as that will make it all but impossible to maintain the code. For the email function, you need the functions Email(), GetRelTopicURL(), GetMaster(), GetTopicPane() and getTopicTitle().
Greet,
Willam
Copy link to clipboard
Copied
Not sure if this helps, but here's a feedback script I named feedback_script.js that I probably tweaked from someone on these forums. It's called from the bottom of each of my topics. It's built around a CHM help so some modification may be needed if viewed outside of a CHM:
<!-- .js file code starts here--> //alert("made it into script"); // Get just the page name var str = location.href; var arr = str.split("::/"); var htm_page = arr[1]; // var mailSubject = '<your product name> Documentation Feedback - ' + htm_page; var mailBody = '[Enter comments here] \n\nMy comments apply to this page: ' + location.href; var mailDisplay = 'Send Feedback on this Topic'; document.write('<a href="#">Back to Top</a> | <a href="mailto:youremail@addresscom' + '?subject=' + escape(mailSubject) + '&body=' + escape(mailBody) + '">' + mailDisplay + '</a>'); <!-- .js file code ends here--> |
I then use this inside each topic (it's in my footer in my master page) to show the link at the bottom of each:
<p style="text-align: center;"><script language="javascript" src="feedback_script.js" type="text/javascript"></script> </p> |