Hi - just getting into the world of variables in Flare, and am wondering if you can use hyperlinks in a variable.
My team and I are working on a project where we have a bunch of documents on a website that we need to hyperlink to, however, our URL may be changing soon (long story with our IT team). A Flare support person suggested that we put the portion of the URL that is subject to change in a variable. With that... we would then insert our hyperlink as an external file and write: [%=VariableSet.VariableName%]/DocumentName.
When that URL changes, we can just change the variable. When doing this and testing it out in a preview it works! Link goes to the correct place. However, in testing it out after we rebuild and publish to our website, the link no longer works and the URL leads to a file not found. When I hover over the link, it looks like it's linking to something that says our URL twice, and drops the variable tag as apart of our url, too, so example: it'll say: http://exampleurl.com/DocumentName/[%=VariableSet.VariableName%]/DocumentName
Anyone have any solutions for this? If not variables, maybe something else?
hyperlinks in variables
-
Lynn_policy_writer
- Jr. Propeller Head
- Posts: 5
- Joined: Tue Feb 07, 2017 4:09 pm
-
BedfordWriter
- Sr. Propeller Head
- Posts: 231
- Joined: Wed Jun 23, 2010 10:13 am
- Location: Nova Scotia
Re: hyperlinks in variables
I use snippets more often than variables. You can edit those offline too. Just be careful to create it as a text snippet, not a block snippet.
I'd put the entire hyperlink and text into the snippet though, not just part.
I'd put the entire hyperlink and text into the snippet though, not just part.
-
wclass
- Propellus Maximus
- Posts: 1238
- Joined: Mon Feb 27, 2006 5:56 am
- Location: Melbourne, Australia
Re: hyperlinks in variables
We have just started using javascript variables so that we can change them in a text file more easily - a side effect is that you can update the value without having to recompile Flare.
For example, we created a file called "reference.js" and store it in the Resources folder - it contains javascript var definitions and the initial value.
We use the items in our skin file in our main project template. Our topic toolbar has several buttons, one of which is a link to an external/company app site, and the URL is different for each project.
Previously, when we created a new project we had to go in and edit the toolbar button event entry each time - that edit is small and hard to see and it was easy to make mistakes. Also, if we updated the skin and did a project global import then we could lose settings - a trap for new players!
Now, the button event has a generic onclick call that does not need to be changed: window.open(myVariableURL, '_blank')
and we define "myVariableURL" in the javascript file. This is published by Flare, but because it is a text file you can update the variable value at any time.
While we don't need to update them after publishing, it is a better solution for us as the skin files can change while we are in development.
hope this helps.
For example, we created a file called "reference.js" and store it in the Resources folder - it contains javascript var definitions and the initial value.
We use the items in our skin file in our main project template. Our topic toolbar has several buttons, one of which is a link to an external/company app site, and the URL is different for each project.
Previously, when we created a new project we had to go in and edit the toolbar button event entry each time - that edit is small and hard to see and it was easy to make mistakes. Also, if we updated the skin and did a project global import then we could lose settings - a trap for new players!
Now, the button event has a generic onclick call that does not need to be changed: window.open(myVariableURL, '_blank')
and we define "myVariableURL" in the javascript file. This is published by Flare, but because it is a text file you can update the variable value at any time.
While we don't need to update them after publishing, it is a better solution for us as the skin files can change while we are in development.
hope this helps.
Margaret Hassall - Melbourne