How to I create a dynamic path to use a link embedded in a cfinclude template?

Discussion in 'Programming' started by Coldfusionstudent, Jul 24, 2009.

  1. #1
    Hi,

    I have a template named "getlogin.cfm" which i use at the top of every single one of my site pages using the cfinclude tag. Inside this "getlogin.cfm" template, I have placed a link to get to the main page of my site called "index.cfm" which is in the root folder.

    The problem is that I cannot hard code the URL of the link inside the "getlogin.cfm" template because if I called the link from the "getlogin.cfm" template that has been embedded in pages that are stored in different folders it will not path correctly to the index.cfm page, giving me a file not found error.

    The question I am asking you kind folks is, how am I able to create a link inside a template which is used in a cfinclude tag that will be able to path correctly no matter where the cfinclude template is used?

    Thank you very much.
     
    Last edited: Jul 24, 2009
    Coldfusionstudent, Jul 24, 2009 IP
  2. CerIs

    CerIs Active Member

    Messages:
    69
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #2
    use a map path , can be setup in cfadmin if you have access
     
    CerIs, Aug 10, 2009 IP
  3. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That should only be a problem if you are using relative paths. An absolute path from the root "/" will always work.
     
    cfStarlight, Aug 10, 2009 IP