FARCRY TIP-OF-THE-DAY 2004-01-27:
When you are starting out defining a new template (or a set of them) start with
the simplest template possible and build it up from there.

What is the simplest template possible??


<!--- @@displayname: <put a friendly name here> --->
<!--- @@author: <put your name here> --->
<cfsetting enablecfoutputonly="yes">

<cfoutput>
#stObj.Body#
</cfoutput>

<cfsetting enablecfoutputonly="no">



That's it.  It's not very fancy but it output's the content for the current
item being displayed.  You could even do it without the comments if you really
wanted - and without the <cfsetting> tags. Then you would just have:


<cfoutput>
#stObj.Body#
</cfoutput>



Everything else you do to create your template is a mixture of
(D|X)HTML/CSS/Cold Fusion.

If you want to test this out, create a file in <your app>/webskin/dmHTML and
call it:

displaypageTipOfDay.cfm  (or something you will remember)

Then, once you have dropped in the code to output the body and saved it, go
into the Admin Console and find any existing dmHTML page and change it's
Display Method to this new file (it should be in the drop-down list next to
Display Method when you edit the dmHTML object).  Once you have saved it (by
going to COMPLETE in the Combo Box), get a "Preview" of the page from the
Overview panel (you dont even have to approve the object).

You will see just a boring page with the content of the object displayed.

Why not go back to the template and add in something like:

<CFDUMP var="#stObj#">

and then refresh the page.  That will give you an idea of what information is
inside stObj.  From there you can use some simple HTML skills (like <h1> and
<p>) to get some formatting going.  If you are an XHTML/CSS guru then you can
pretty it up any way you like.

But...... start simple.


---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to