>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

Controlling blogCFC PODs with textBlocks

If you use/change PODs a lot in blogCFC then it might be an idea to pass control of the POD content to the admin area. You can do this using the TextBlock feature.

Once you have created and uploaded your pod (code shown below) you will no longer have to upload the pod page again to make changes as this can be done via the textBlocks feature in the admin area.

How?

1. Create a 'Textblock' in the Admin area and take note of the Label. The body/text you enter here will show in your POD. Note: CF in not valid.

2. Create your POD page in your \blogname\includes\pods\ folder. This should be the only time you touch this.

3. Add your pod to your \blogname\tags\layout.cfm page (with a cfinclude) i.e.

4. Upload your pages (yourNewPod.cfm and layout.cfm) - you can do this in the file manager

Use this code in your POD page:

<cfsetting enablecfoutputonly=true>
<cfprocessingdirective pageencoding="utf-8">

<cfmodule template="../../tags/podlayout.cfm" title="Links">
<!--- here we use the textblock to get information for the pod --->
<cfset request.textBlock = application.textblock.getTextBlock("YourTextBlock") />
<cfoutput>
<!--- check to make sure that the body exists (this may get updated at some point so we need this check) --->
<cfif structKeyExists(request.textBlock,"body")>
#request.textBlock.body#
<cfelse>
Text block failed
</cfif>

</cfoutput>

</cfmodule>
   
<cfsetting enablecfoutputonly=false>

Many thanks to rwhaun.


 

Related Blog Entries

Comments
rwhaun's Gravatar Nice work! Glad to see I was of help. And props to you for being a good programmer and giving credit. We need more folks like you serving the CF community!
# Posted By rwhaun | 10/10/06 17:49 | Report abusive comment
Scott P's Gravatar Shameless plug for the BlogCFC Pod Manager I just put out this weekend.

http://scottpinkston.org/blog/index.cfm/2006/10/14...
# Posted By Scott P | 16/10/06 19:57 | Report abusive comment
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.