Mike, it sounds like you're being micro-managed. ;-)
Seriously, though, don't make it more complicated than it has to be. A
custom tag is simply another way to call a CF module that gives you 'extra'
abilities. For example, say you have a module called 'menu.cfm' that
displays your nav menu. From your index.cfm module you might have at the
top a line of code like this:
<cfinclude template="menu.cfm">
This includes the code from menu.cfm and displays the menu. You could also
have had:
<cf_menu>
That would do EXACTLY the same thing, and your menu was just called as a
custom tag.
I think the question here is what 'flexibility' does the tag need to have?
Do you need to be able to pass certain parameters to make it do one thing or
another? I another e-mail you said it is not dynamic.
Your task may be as simple as just calling the module as a custom tag and
doing nothing more than that. If you have any dynamic values, pass them as
an attribute. For example, let's say that you have a simple menu file like
this:
menu.cfm:
<a href="home.cfm">Home</a> || <a href="home2.cfm">Home 2</a> || <a
href="logout.cfm">Logout</a><br>
Now let's say you want to display this at the top of all your pages and so
you include the following code in your Application.cfm (not necessarily
recommending this practice, just using it as an example):
<cf_menu>
Voila, your menu now appears at the top of all your pages. Now, if you want
to get fancy and say, keep the menu link from being displayed as a link if
you're on the same page, you might do this:
menu.cfm:
<cfparam name="attributes.which_page">
<cfif attributes.which_page EQ "home">
Home
<cfelse>
<a href="home.cfm">Home</a>
</cfif>
||
<cfif attributes.which_page EQ "home2">
Home 2
<cfelse>
<a href="home2.cfm">Home 2</a>
</cfif>
|| <a href="logout.cfm">Logout</a><br>
Now when you call your custom tag, you might do this:
In the home.cfm page, you call <cf_menu which_page="home"> and in the
home2.cfm page, you call <cf_menu which_page="home2">. Now when you are on
the home2.cfm page, the 'home 2' is no longer a link, just text, and when
you click on 'home', it changes and becomes just text and 'home 2' becomes a
link again.
I'm not recommending you code it this way, just giving you some ideas.
Hope this helps....if not, maybe post some code so we can help you work it
out that way...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4568
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15