Can I Use a variable with a Mailto link?

This forum is for all Flare issues not related to any of the other categories.
Post Reply
lizat
Sr. Propeller Head
Posts: 282
Joined: Sun Feb 01, 2009 3:49 am
Location: London, UK

Can I Use a variable with a Mailto link?

Post by lizat »

Dear Madcaps,

I have looked in help but can't find a reference to this, although I find it hard to believe it isn't there somewhere. I want to use a variable in my mailto link how would I do this?

thank you..................................... liz
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Can I Use a variable with a Mailto link?

Post by doc_guy »

I don't think you can do that using Flare's implementation of variables. Why? Because you'd be putting a tag inside a tag, which isn't allowed.

The underlying code for an email link looks something like this:

Code: Select all

<a mailto:"paul@example.com"> Send me an e-mail </a>
But variables are done with code like this:

Code: Select all

<MadCap:variable name="MyVariables.EmailAddress" />
So what you want it to do is create this:

Code: Select all

<a mailto:"<MadCap:variable name="MyVariables.EmailAddress" />"> Send me an e-mail </a>
This isn't valid XML construction, so it doesn't work.
Paul Pehrson
My Blog

Image
lizat
Sr. Propeller Head
Posts: 282
Joined: Sun Feb 01, 2009 3:49 am
Location: London, UK

Re: Can I Use a variable with a Mailto link?

Post by lizat »

paul,

Thanks for the information, I understand.

What I wanted to do was have something where I didn't have to edit pages if the mailto person changes. I shall use a snippet with the mailto link in.
Where I need it to be independent of Flare I shall use an outlook template and macro that is linked to.

thanks............................... liz
AudreyC
Propeller Head
Posts: 18
Joined: Thu Dec 13, 2007 9:18 am
Location: Dundee, Scotland

Re: Can I Use a variable with a Mailto link?

Post by AudreyC »

My solution to the above problem has been to create a snippet with the hyperlink (including the email & subject ). It's not perfect, but it's better than having to change it every time. Though I would be keen to hear if anyone has a better way of including the topic automatically?
Audrey Christophory
Technical Writer
Realtime Worlds
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Can I Use a variable with a Mailto link?

Post by doc_guy »

Depends. Off the top of my head, I think that there is a somewhat complex solution that would work. It would mean setting the page extension to .php (in the target editor), and then adding php code to the masterpage (where you could use a combination of PHP and Flare Variables to set up a PHP variable), and then calling that PHP variable in the text where you need it.

So you would set up a PHP variable that would be document title, and you'd set it to the MadCap Variable Doc Title. Then you could call the PHP variable where you need it in the document, including in a mailto: link.

But I dunno if it would work.... And I'm not in a position right now to test it. Just to muse about it ;)
Paul Pehrson
My Blog

Image
Post Reply