Snippet variable

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
psy
Jr. Propeller Head
Posts: 3
Joined: Tue Aug 09, 2016 12:13 am

Snippet variable

Post by psy »

Hello,

I struggling to replace the url in the <a href="url"> with s snippet variable.
I want the url "Specification.htm" to be replaced by the variable <MadCap:variable name="DocTyper.Adress" />
but i failing the get the syntax right, quotes ( " ' \" ) confuse me :(

Part of the code in the snippet that is called with the two variables (DocTyper.DocType and DocTyper.Adress)
.....
<div class="clickable">
<p class="tile-title"><a href="Specifikation.htm"><MadCap:variable name="DocTyper.DocType" /></a>
</p>
<p class="tile-content"><MadCap:variable name="DocTyper.Adress" />
</p>
</div>
......
Thank you
Per
trent the thief
Propellus Maximus
Posts: 608
Joined: Wed Feb 01, 2006 6:21 am
Location: Off in the dark....

Re: Snippet variable

Post by trent the thief »

Hello Psy,

DocGuy has an old post with examples explaining that Flare does support placing an xml tag within another tag.

viewtopic.php?f=13&t=8709

Sorry.
Trent.

Certifiable.

Image

umm...
I meant MAD Certified.

Official Propeller Beanie Owner :-)

:flare: Are you on Flare's Slack channels? PM me for an invitation! :flare:
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Snippet variable

Post by NorthEast »

When you insert a hyperlink (to a website), you can insert a variable by clicking the 'Select variable' icon (on the right of the field).

In the code, it'll look something like this:

Code: Select all

<a href="[%=DocTyper.Adress%]">
psy
Jr. Propeller Head
Posts: 3
Joined: Tue Aug 09, 2016 12:13 am

Re: Snippet variable

Post by psy »

Thanks Dave,

In fact I had to make a solution using a small javascipt because there were some other things i had to consider. One of them being that depending on the url being (http://) or just a hyperlink on the same website, the new page must open in a new tab (_blank) or (_self) . Anyway, problem solved :D
Post Reply