Announcement

Collapse
No announcement yet.

Putting a URL into a Variable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Putting a URL into a Variable?

    I want to place a url link for a newly created page into a customised variable for a nav button - and not hard code it. Am probably being thick but I cannot find/search an explaination of this here or in the help and user guide files. I'm fine with image and text variables but in the dark regarding URL's in variables.

    Anyone give me a pointer, please?

    #2
    Many possibles but here's a simple way...

    Create a text variable with Site scope, then in your outer layout include the variable name in the link....something like this:

    Code:
    <actinic:block if="%3cactinic%3avariable%20name%3d%22My%20URL%20Link%22%20%2f%3e%20%3c%3e%20%22%22">
    <a href="<actinic:variable name="My URL Link" />" target="_self" ><img src="my_link_image.gif" border="0" /></a>
    </actinic:block>
    Where My URL link s defined in Site Settings Properties as say My_Page_Link.html. If not defined then the blockif will block the code in the layout. You nay also want to add another text variable for alt text in the same way.

    Comment


      #3
      Hi Sean.
      You can do this using a text variable. Just set the value of the variable to the URL and then use the variable in the HREF inplace of the URL.

      Comment


        #4
        Beat me to it Duncan. And I thought I was up early for a Saturday!

        Comment


          #5
          Thanks

          ..so a url variable is created by inputting a url in the value field of a new variable - and can be displayed in the 'links' section under site options for easier further editing. Got that down now thanks Duncan/Dom. Like the use of the blocks if a link isn't defined Duncan.

          A couple more questions please if poss':

          1/The new variable in my new nav button doesn't have the 'P_' prefix on it's url when I hover over it (that the other buttons display) - do I have to create a page for the preview folder manually to get a page going in the preview and site files folder?


          2/Why are some variables displayed in normal weight blue type and others in bold?

          Many Thanks guys. Sean

          Comment

          Working...
          X