Show Source to Friends

This is not really a tutorial but a helper file for people trying to solve programming issues with a friends help. By using this code snippet in your templates you can send the template url to a friend than they can easily see your entire code and perhaps help you solve that one little glitch that is escaping you. This is much easier than having to post a lengthy template or for that matter email a long template to your friends. I use this myself and have made it a practice after reading Eric Meyer's tutorial on Automatically adding comments to a CF template. The link I use is placed in the bottom of the template right before the closing body tag.


<!--- Put on top of your Template --->
<cfif IsDefined("url.show")>
     <cffile action="READ" file="#PATH_TRANSLATED#" variable="thisfile">
     <cfoutput>
<html><body><pre>#htmleditformat(thisfile)#</pre></body></html></cfoutput>
     <cfabort>
</cfif>





<!--- Put This Link Before final closing body tag --->

<cfoutput><center><a href="#GetFileFromPath(PATH_TRANSLATED)#?show=yes">Show Source</a></center></cfoutput>

All ColdFusion Tutorials By Author: Redmanz
  • Send Page Url to A Friend
    A simple script where a user can click a link that will take the current templates url and pass it to a email form which they can than fill in with their friends emails addresses to send their friends your site address.
    Author: Redmanz
    Views: 39,196
    Posted Date: Saturday, November 23, 2002
  • Advanced Form Checking
    This tutorial places the submitted form values into a session, than error checks them. If there is an error it will show the form again with the previous values the user entered pre-entered in the form. It will also tell the user which form fields had errors in them.
    Author: Redmanz
    Views: 53,958
    Posted Date: Tuesday, November 26, 2002
  • Dynamic Sorting
    This tutorial shows the basics of allowing your end-users to dynamically sort the order in which they view your records. You can have as many sort orders as you have fields viewed!
    Author: Redmanz
    Views: 34,213
    Posted Date: Thursday, December 5, 2002
  • Duplicate Data Checking
    This tutorial uses a opt-in mailing list as an example. After the end-user enters their information the information goes to an action page which checks to see if the users email address already exists in the database. If it exists it lets them know and will not enter the duplicate data, if it does not exist it enters them into the mailing list.
    Author: Redmanz
    Views: 36,916
    Posted Date: Monday, December 9, 2002
  • Guest Book (Part 1 / 2)
    This Guestbook is part one of a two part tutorial. This part deals with the guest book itself the second part will build a administration area for this guestbook. The guest book submits to two tables in a mySql database the first table being for the actual guest book display template and the second table to be used for an opt-in mailing list.
    Author: Redmanz
    Views: 51,764
    Posted Date: Friday, December 13, 2002
  • Guest Book (Part 2 / 2)
    This is part two of my guestbook tutorial, in part one we created the actual guestbook. In this part we will now look at creating an administration area for our guestbook. In this admin area we will be able to edit and delete guestbook entries as well as add or delete administrators.
    Author: Redmanz
    Views: 34,282
    Posted Date: Saturday, December 21, 2002
  • Show Source to Friends
    Not really a tutorial but some code to help you solve programming problems by showing your code online to your friends or associates.
    Author: Redmanz
    Views: 25,577
    Posted Date: Tuesday, February 18, 2003
Download the EasyCFM.COM Browser Toolbar!