Skip to main content
Inspiring
October 17, 2017
Question

Probleme de #

  • October 17, 2017
  • 3 replies
  • 783 views

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 has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    October 18, 2017

    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")>

    ZNBAuthor
    Inspiring
    October 19, 2017

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

    Thanks

    BKBK
    Community Expert
    Community Expert
    October 19, 2017

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

    WolfShade
    Legend
    October 17, 2017

    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,

    ^ _ ^

    ZNBAuthor
    Inspiring
    October 17, 2017

    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

    WolfShade
    Legend
    October 17, 2017

    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,

    ^ _ ^

    EddieLotter
    Inspiring
    October 17, 2017

    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