I am building a "catalog" style page that allows users to click a link on a catalog entry and have the request ticket filled out based on variable query parameters. Naturally, as the catalog grows and changes, I wanted to create a Snippet for the request link, which I can just drop in an set to different variable definitions.
My Snippet code looks (basically) like this:
Code: Select all
<a class="ctabutton" href="https://www.mywebsite.com/request?ref=[%=CatalogEntry.CatalogRef%]>
Purchase <MadCap:variable name="CatalogEntry.CatalogRef" />
</a>
When I publish it (to an HTML5 Target), however, choosing the variable definition works for the display text variable (<MadCap:variable name="CatalogEntry.CatalogRef" />) but for the URL, it takes the variable definition set in the Target.
So on my web page, it looks like this:
- Purchase REF-001
- Purchase REF-002
- Purchase REF-003
<a class="ctabutton" href="https://www.mywebsite.com/request?ref=[b]REF-001[/b]">Purchase REF-001[/b"</a>
<a class="ctabutton" href="https://www.mywebsite.com/request?ref=[b]REF-001">Purchase REF-002</a>
<a class="ctabutton" href="https://www.mywebsite.com/request?ref=[b]REF-001[/b]">Purchase REF-003</a>
Does anyone have any thoughts on how I can get around this so that I can re-use this Snippet and the URL changes along with the display text variable?
Thank you!