If you just pop in 

<cfif StructCount(url) eq 0 AND Len(cgi.query_string)>
  <cfset attributes.fuseaction = cgi.query_string>
</cfif>

at the top of index.cfm, you've added all you need to translate the single-word-
after-question-mark syntax into a fuseaction.

For a little added security, you could do something like this:

<cfset AllowedCommands = "Haberdashery.SportingGoods.MensFittings.OuterWear">
<cfif FindNoCase(cgi.query_string, AllowedCommands)>
  <cfset attributes.fuseaction = cgi.query_string>
<cfelse>
  <cfset attributes.fuseaction= "showCatalog">
</cfif>

So that only those areas you want to open to url visitors are available that 
way.  Note that if any valid URL key/value pairs are passed, all this gets 
ignored.

- Jeff

On 16 Apr 2001, at 10:38, Steve Ray wrote:

> Jeff -
> 
> That's a real neat idea, but it seems to screw with FormURL2Attributes (at least the 
>copy I'm working with, which
> is not one of the newer, reworked flavors). Maybe I'm putting your code in the wrong 
>place. I have it after the
> 
> <cfparam name="attributes.fuseaction" default="show_login">
> line in my app_local.
> 
> Anyway, the error I get (when trying to go directly to my show_menu fuse) is:
> 
> An error occurred while evaluating the expression:
> SetVariable("caller.attributes.#urlname#" , "#evaluate("url."&"#urlname#")#")
> Error near line 6, column 10.
> 
> An error has occurred while processing the expression:
>    url.show_menu
> Error near line 1, column 1.
> Error resolving parameter URL.SHOW_MENU
> 
> Any ideas? Thanks loads.
> 
> 
> Steve Ray
> 
> 
> 
> Jeff Peters wrote:
> 
> > I can certainly understand the need to conform to client wishes, but it seems
> > to me like an awful lot of work to undertake just so a client can have URLs
> > like the ones he's used to puttering with on his static FrontPaged sites.
> >
> > That said, here's a way to give 'em a quick shot into sections of your
> > Fuseboxed site:
> >
> > <cfif StructCount(url) eq 0 AND Len(cgi.query_string)>
> >   <cfset attributes.fuseaction = cgi.query_string>
> > </cfif>
> >
> > Then use some nice tidy fuseaction names for the sections you want them to have
> > easy access to, and tell them to use the following url syntax:
> >
> > www.mysite.com?Haberdashery
> >
> > Instead of a slash, they have a question mark, but is this a big deal?  Anyway,
> > the workings:  Since there are no key/value pairs in the url, CF can't set any
> > variables in the URL structure.  However, there is something in the
> > cgi.query_string variable--everything that follows the ? on the url.  Since
> > there are no valid pairs, but there's still a value in the query string, we can
> > use that value for the fuseaction.  You could also add a check to limit which
> > words you'll accept as fuseactions through this method.  NOTE: this relies on
> > index.cfm being the default document for your webserver.
> >
> > - Jeff
> >
> > On 14 Apr 2001, at 15:03, Ken Beard wrote:
> >
> > > I have definitely had feedback from clients and such
> > > non-coding types that they would prefer to have
> > > www.website.com/products/index.cfm?fuseaction=list
> > > to www.website.com/index.cfm?fuseaction=products.list
> > > and that they would ultimately prefer to see
> > > www.website.com/products/list.cfm?yadda or even
> > > .....products/list.cfm with no ?yadda.  Why is this?
> > > two reasons..
> > >
> > > 1. to a non-programmer, everything after the ? is
> > > affectionately known as "gobbledygook" and hence is
> > > ignored because it has no meaning.
> > >
> > > 2. from our client's perspective it is more
> > > conventient to tell a customer or client check out the
> > > investor information on our website at
> > > www.oursite.com/investors than to tell them to go to
> > > www.oursite.com and click on investors on the menu at
> > > the top of the page (which they will need help
> > > finding).
> > >
> > > I prefer to route all page calls through a central
> > > index.. but the customers want multiple directories.
> > > I have not tried this yet, but what if we structure
> > > our site like
> > > /fbsite/ - put the whole fusebox site here, out of the
> > > webroot.
> > > /website/ - put a bunch of mostly blank files here
> > >
> > > and then maybe even have the fuseminder script or
> > > something similar that works off an already-written
> > > set of index.cfm files create a bunch of
> > > sub-directories and (all but) blank cfm files off the
> > > /website/ directory, which is where the domain would
> > > be mapped to.
> > > Then have an application.cfm file in the /website/
> > > directory that uses the extra directories and filename
> > > as the fuseaction, with something like the following:
> > >
> > > <cfscript>
> > > url_website="www.StanCoxRocks.com";
> > > cfPathToFBSite="/fbsite/";
> > >
> > > extradir=right(cgi.path_info,len(cgi.path_info)-len(url_webapproot));
> > >
> > > if(len(extradir)){
> > >     fa=replace(extradir,".cfm","");
> > >     fa=replace(fa,"/",".","all");
> > >     if(right(fa,1) is "."){
> > >         fa=left(fa,len(fa)-1);
> > >     }
> > >     attributes.fuseaction=fa;
> > > }
> > > </cfscript>
> > >
> > > <!--- call the fusebox site --->
> > > <cfinclude template="#cfPathToFBSite#index.cfm">
> > > <cfabort>
> > >
> > > We would have to do something similar for links and
> > > cflocations to keep this formatting throughout a
> > > client's visit to the site.  When 5.0 arrives we could
> > > make a udf.
> > >
> > > =====
> > > Ken Beard
> > > cfug manager
> > > Tampa, FL
> > > [EMAIL PROTECTED]
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to