How to detect the .cfm currently being visited.

When the user is at "index.cfm", how can I write a cfif tag to detect this?
Basically I want my navigation menu to look different depending on the user's location ofcourse I could simply change the CSS of the menu for each page, but I'm using cfinclude to place the menu around the site, so there's only 1 version of the menu.
Thanks!

Without knowing the larger picture of your web application, here are a few places/ways to determine the current page:
If you are using Application.cfc, the current page is passed as a parameter to the onRequestStart method. The parameter is called 'targetPage' by default (though I imagine you could change that) and it contains the path, from the web root, to the page that's being called. If the page being called is www.mydomain.com/index.cfm, this parameter's value would be 'index.cfm'.
Example:
<cffunction name="onRequestStart">
  <cfargument name="targetPage" />
  <cfif targetPage is "index.cfm">
    <!--- do something here based on page being requested --->
  </cfif>
</cffunction>
You can also use CGI variables on any CML page in your application to get the page name. Of the many variables in the CGI scope, script_name is probably the best one to use.
Example:
<cfif cgi.script_name is "index.cfm">
  <!--- do something here based on page being requested --->
</cfif>
Hopefully, the above will get you started. Good luck and have fun!

Similar Messages

  • How to get the most current file based on date and time stamp using SSIS?

    Hello,
    Let us assume that files get copied in a specific directory. We need to pick up a file and load data. Can you guys let me know how to get the most current file based on date and time stamp using SSIS?
    Thanks
    thx regards dinesh vv

    hi simon
    i excuted this script it is giving error..
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    namespace ST_9a6d985a04b249c2addd766b58fee890.csproj
        [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
            The execution engine calls this method when the task executes.
            To access the object model, use the Dts property. Connections, variables, events,
            and logging features are available as members of the Dts property as shown in the following examples.
            To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
            To post a log entry, call Dts.Log("This is my log text", 999, null);
            To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
            To use the connections collection use something like the following:
            ConnectionManager cm = Dts.Connections.Add("OLEDB");
            cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
            Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
            To open Help, press F1.
            public void Main()
                string file = Dts.Variables["User::FolderName"].Value.ToString();
                string[] files = System.IO.Directory.GetFiles(Dts.Variables["User::FolderName"].Value.ToString());
                System.IO.FileInfo finf;
                DateTime currentDate = new DateTime();
                string lastFile = string.Empty;
                foreach (string f in files)
                    finf = new System.IO.FileInfo(f);
                    if (finf.CreationTime >= currentDate)
                        currentDate = finf.CreationTime;
                        lastFile = f;
                Dts.Variables["User::LastFile"].Value = lastFile;
                Dts.TaskResult = (int)ScriptResults.Success;
    thx regards dinesh vv

  • How to stop the Dialog from being dragged

    I was hoping that someone could tell me when calling a Dialog from Jframe, a how to stop the Dialog from being dragged
    while a dialog is showing.
    When it is visible I can still click and drag the Dialog
    I want to set it so you can not drag it until the dialog has be closed.

    If you don't have access to the parent frame, a "hack" that usually works:
    Frame frame = Frame.getFrames()[0];
    if (null != frame && frame instanceof JFrame){
    JFrame jf = (JFrame)frame;
    JDialog jd = new JDialog(jf, "title");
    ... code here ...
    As each JFrame (or Frame) is opened, its stored in the array of Frames that you can get. Same thing with Dialog.getDialogs(). Almost always, at least so far for me I've never had this problem, the [0] index is the main window opened, or the parent/top frame. I'd put the check in there to be safe and make sure its a JFrame and usually you'll only have the one JFrame.

  • How to detect the Acrobat Browser Plug-in version installed on a users system for non-IE browsers?

    How to detect the *Acrobat Browser Plug-in version* installed on a users system, on Firefox, Safari, Opera, etc?
    Or one script for detecting Plug-in version for major browsers. Need full example code.

    Wrote an article on this with code samples (Javascript + HTML) - basically there are differences between IE and other browsers. Chrome natively comes with the Chrome PDF Viewer so I've incorporated that in my detection script.
    The script detects the browser type, and the installed acrobat version...
    Have a look here:
    Detect the Adobe Reader Plugin

  • How to detect the path of Temp directory

    I am writing a class library which allows users to manipulate a database in the web server java applications/applets. In my logic the Application/Applet communicate with a CGI script/Servlet in the server and that do all the database handling. My objective is to make the Client independant from the Database Drivers, and to some restrictions and possible security threats that can arrice when accessing the database directly.
    99% of the work is done and now I am doing the fine tuning.
    My Problem:
    When the user downloading a blob object from the server database. each time the program read the blob it will get a new copy from the server. This is not good if the blob is large (few 100 megs) . So I am going to implement a cache system. but the problem is If I am caching in the memory it will not support large objects (Memory is a limited factor). So the preferance is use the Temperary files but I do not know how to detect the path to temperary folder.
    And my 2nd questions is are the applets allowed to write and read in temperary folder.

    The Java default temporary file path can be determined with
    System.getProperty("java.io.tmpdir")This is typically the same value as the os environment variable

  • How to detect the HTML extension window close in In-design? Does the In-design throws any event on opening/closing of extensions?

    How to detect the HTML extension window close in In-design? Does the In-design throws any event on opening/closing of extensions?
    I have a HTML extension running in In-design CC 2014 version.
    I want to perform some required set of actions before my extension window is closed(by clicking on the cross button on top right corner).
    Does In-design throws any event for it? Or can we capture it using C++ plugin in some way?

    Naah.......haven't got any event for that yet.
    Although, since HTML extensions are using chromium browser,  as a workaround, u can attach listener to HTML onClose event, but it won't solve any purpose if you
    are looking to logout session or do some business login in your code.

  • How to detect the final loop iteration of a step in a PostStep Engine Callback?

    I see the need to use a PostStep Engine Callback and look at the Step.Result container of the caller.
    My issue: If the caller is configured to loop, the PostStep Engine CB executes with each iteration and I do not see how to detect the final iteration (which is the only iteration I am interested in).
    Ideas are welcome. Thanks in advance,
    Guenter

    Guenter,
    well, the way i discripted IS the generic way. The reason for this is the following:
    You can compare TestStand very well with procedural programming languages. So you have variables with different lifetimes and scope. RunState is one variable, which is available in every scope, but it may have different content.
    So you leaving the execution of your clientsequence in order to call the callback, you leave the scope of the RunState from your clientsequence. But only there the information is stored on how many iterations are left. It does not make sense to pass this anywhere, since the execution of your clientsequence has to decide if to loop further or not.
    But, please note that there are different scopes for the "disable result recording" as well. You have found the most global one, the station option. But you can as well set this in the sequence settings (Edit >> Sequence Properties >> Disable Result Recording for All Steps) and at step-level (Run Options >> Record Result {uncheck it}).
    Looping on a single step using the step settings, you can additionally choose not to record results for each iteration. This will lead to only a single entry in the ResultList, the overall result of the looped step (if resultcollection is enabled of course!).
    hope this helps,
    Norbert 
    Message Edited by Norbert B on 08-22-2008 02:10 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How to detect the sign of a number?

    I have output which gives either negative number or positive number. My problems is how to detect the sign of the number and output boolean value? For example if input number is negative like -23.11 I want to output false and if the number is positive like 17.99 I want to output true.
    T H A N K S!
    Solved!
    Go to Solution.

    Message Edited by Phillip Brooks on 07-16-2009 11:08 AM
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Does any body knows how to detect the resolution of an inserted image in word?

    Does any body knows how to detect the resolution of an inserted image in word?

    I'm not sure I understand your reply but when you insert images into Word that are larger than will fit on the page, they are automatically compressed. If you right click and select Size and Position you can restore it to 100% but you will not see all the image.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • HOW TO TRACE THE PLSQL API BEING CALLED WHEN WE USE FORM

    Dear ALL,
    How I can track the PLSQL API name when we press any button in form.
    For example when I click on Bill By Requirement button on EAM Work Order Billing FORM , how will I know which PLSQL API is being called.
    Please give me an idea about how to identify the PLSQL API being called.
    Thanks and Regards,
    Lavan

    Please refer to (FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]).
    Thanks,
    Hussein

  • How to detect the key enter with a numerical control without using loop event?

    I want to accept a numerical value only when the key enter is pressed, but without using the event. How to detect the char "enter" with a numerical control?
    Thanks!

    When the user edits a numeric control with a keyboard, its property "key focus" is true. When the user hits enter, key focus becomes false. Poll the property to latch the control valuse at the true-false transition. That won't work if the user modify the control using up and down arrows.
    LabVIEW, C'est LabVIEW

  • [svn] 3687: Add some messaging tests for scenarios that involve subscribing to a destination , disconnecting from the channel currently being used and resubscribing to the destination .

    Revision: 3687
    Author: [email protected]
    Date: 2008-10-16 11:23:39 -0700 (Thu, 16 Oct 2008)
    Log Message:
    Add some messaging tests for scenarios that involve subscribing to a destination, disconnecting from the channel currently being used and resubscribing to the destination. There is an issue that is causing the streaming/multipleDisconnectsResubscribesTest.mxml test to fail that I will log a bug for.
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/disconnectResubscribeJMSTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/disconnectResubscribeTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/multipleDisconnectsResubscribesTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/disconnectResubscribeJMSTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/disconnectResubscribeTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/multipleDisconnectsResubscribesTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/disconnectResubscribeJMSTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/disconnectResubscribeTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/multipleDisconnectsResubscribesTest.mxml

    Revision: 3687
    Author: [email protected]
    Date: 2008-10-16 11:23:39 -0700 (Thu, 16 Oct 2008)
    Log Message:
    Add some messaging tests for scenarios that involve subscribing to a destination, disconnecting from the channel currently being used and resubscribing to the destination. There is an issue that is causing the streaming/multipleDisconnectsResubscribesTest.mxml test to fail that I will log a bug for.
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/disconnectResubscribeJMSTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/disconnectResubscribeTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/longpolling/multipleDisconnectsResubscribesTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/disconnectResubscribeJMSTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/disconnectResubscribeTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/polling/multipleDisconnectsResubscribesTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/disconnectResubscribeJMSTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/disconnectResubscribeTest.mxml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/unsubscribeScen arios/streaming/multipleDisconnectsResubscribesTest.mxml

  • How to detect  the Collission for duplicated movieclps

    Hey guys .. i am back with set of query..till now .. key
    press movement a rocket (mc) is moving left right up down in a
    defined stage area. and i am able to generate some fire balls
    randomize falling from top. this is just i am duplicating the movie
    clip(fireball_mc) .... now i want incase or when the rocket (mc)
    touch the fire ball programm shold detect the collsion and generate
    a score board. well for this i have tried a script for two movie
    clips ... wchich is working but ..i don know or i m not gettng the
    logic how to detect the collission for duplicated movie clips...
    well i m just giving the script for oinly 2 movie clips
    coliding...can any one tell me how to do it with randmize or
    duplkicated mcs??
    for 2 movie clip ...
    _root.mc1.onEnterFrame = function() {
    if(this.hitTest(_root.egg)) {
    _root.result="Oh no..... we are dead";
    } else {
    _root.result="we are going fine";
    (this is happening ..but let me know how can i get the same
    result for ranndom mcs)
    hope someone can help me out ...
    i appriciate ur valuable time to read this..
    thanking you

    Hey thx for ur suggestion...but as i said m very much new to
    actionscript (more designer) so i don have much idea... most of the
    things i m doing for this game i m going through lots of references
    then i tried to understand te codes m implmenting them to my
    need..can u explain me little more about arrays u haves asked for
    loops u asked me to use the hittest function..please /.. i will be
    greatfull to u... thx

  • How to reset the iphone without being able to use the screen?

    how to reset the iphone without being able to use the screen?

    What do you mean by reset?
    Reset: Hold the Sleep/Wake and Home buttons and don’t let go until the screen goes dark and the Apple logo appears (no data will be lost)
    or wipe and restore?

Maybe you are looking for

  • Itunes will not open even after I reinstalled Quick time!!!  Help!

    Okay, I have read lots of information on this site and did everything as instructed, but I am still having problems. I installed the new version of Itunes, then got a "audio configuration problem" message. So, I removed Quicktime and then re-installe

  • How to do a TopN Sort based on a formula

    Hi all, My report has two groups, Store and Department.  In the details section are multiple jobs per store with costs. These are subtotalled by Store and Department.  I want to compare total spend for each store with the store budget and produce a l

  • Shockwave data persistence

    Can anyone point me in the right direction? I have a large training program which I am moving online. I will therefore need to break it up into a number of different shockwave files. The user will log in to the program but how do I make their data pe

  • Oracle 11g on Windows 7 (2)

    Hi! I have successfully installed Oracle 11gR1 on Windows 7 Home Premium Edition. The database is up and running, however, I cannot create Windows users and groups (probably due to the version), so that I can execute Export and Import jobs. Is there

  • How long is the shuffle warranty?

    I don't know if mine has ever worked properly, always have that little orange light flashing but have been able to update etc, up till now. Now my imac doesn't recognize it anymore so I can't update. Bought it April 2005. Too late?