Skip to main content
Inspiring
Oct 17, 2017 2:32 PM UTC
Question

Probleme de #

Hello


I do not understand why the following phrase is good:


<CFFORM action="../../Admin/_modules/inc_Modale.cfm?fen=Pop.LoginEntry.cfm&PageUrl=#PageUrl###oModal" method="post">


and the next one does not pass:

<CFINCLUDE template="../../Admin/_modules/inc_Modale.cfm?fen=Pop.cookies.cfm##oModal">

thank you in advance for your help

    This topic is closed to new replies. Start a new post to keep the conversation going.

    7 replies

    BKBK
    Community Expert
    Community Expert
    Oct 18, 2017 10:22 AM UTC

    ZNB  wrote

    Hello


    I do not understand why the following phrase is good:


    <CFFORM action="../../Admin/_modules/inc_Modale.cfm?fen=Pop.LoginEntry.cfm&PageUrl=#PageUrl###oMo dal" method="post">


    and the next one does not pass:

    <CFINCLUDE template="../../Admin/_modules/inc_Modale.cfm?fen=Pop.cookies.cfm##oModal">

    The reason for the difference is page context. The first case passes because the context of the page for the URL variables is the action page, not the current (form) page.

    Whereas, the context of the cfinclude is the current page. As EddieLotter says, ColdFusion then expects the value of the template attribute to be a file-path relative to the current page. However, in this case, the appended URL variables aren't part of the file-path. Hence the error.

    To "include" the context of the new page into the current page, you could do something like

    <cfset getPageContext().include("../../Admin/_modules/inc_Modale.cfm?fen=Pop.cookies.cfm##oModal")>

    Translate
    ZNBAuthor
    Inspiring
    Oct 19, 2017 9:14 AM UTC

    Hello,
    I was inspired by this article:
    http://www.trucsweb.com/tutoriels/css/css-modal/#fermer
    to make the windows.

    Thanks

    Translate
    BKBK
    Community Expert
    Community Expert
    Oct 19, 2017 10:01 AM UTC

    Thanks for sharing your discovery. Please mark it as the correct answer. It will help someone else in future.

    Translate
    WolfShade
    Legend
    Oct 17, 2017 4:46 PM UTC

    As per EddieLotter​'s suggestion, should you need to pass a value to the template, you can set a variable with that value (prior to the cfinclude) and then reference the variable within the template.

    HTH,

    ^ _ ^

    Translate
    ZNBAuthor
    Inspiring
    Oct 17, 2017 4:57 PM UTC

    Thank you for your answers.

    I suspected that it came from there ;-)
    But for the window to be modal I need to pass "#oModal"
    and do not know how to do it!

    Thanks

    Translate
    WolfShade
    Legend
    Oct 17, 2017 6:24 PM UTC

    Unfortunately, I do not have an answer for that.  I have never used fragments (#oModal, for example) to activate modal windows.  Perhaps you could set a variable called oModal to either true or false, and inside the CFINCLUDE template, use that as a conditional to display the page in modal or not?

    HTH,

    ^ _ ^

    Translate
    EddieLotter
    Inspiring
    Oct 17, 2017 2:54 PM UTC

    The cfInclude tag's parameter is a reference to a file on disk, but you are providing a URL with URL parameters.

    Try:

    <CFINCLUDE template="../../Admin/_modules/inc_Modale.cfm">

    Cheers

    Eddie

    Translate