Hello all - Thank you for responding to my question. However, I am having
trouble getting the syntax correct for ContentObjectGetMultiple and
ContentObject. I think what is throwing me is where to use the variable I am
using to represent the ContentObjectType ID.
Immediately following is the error I get when I run the script. Following
that is the crucial parts of the script.
Here is the error:
Error Diagnostic Information
An error occurred while evaluating the expression:
#section1.Category#
Error near line 66, column 52.
----------------------------------------------------------------------------
----
Error resolving parameter SECTION1.CATEGORY
The object CATEGORY is not present in the scope named SECTION1. It is likely
that you have misspelled the name of the object you are trying to access.
The error occurred while processing an element with a general identifier of
(#section1.Category#), occupying document position (66:51) to (66:69).
Here is the script:
<!---Assign the value of the favoriteSection preference (Type UUID) to
variable section1--->
<CFSET section1 = request.stUserProfile.preferences.favoriteSection>
<td>
<!---display user's preferential headline color and welcome user--->
<div align="center"><font face="Arial" color="#headlinecolor#"><h3>Welcome
#request.cfa.activeuser#!
<p>Here are the top stories in your favorite areas for
#today#.</p></h3></font></div>
<!---Get Objects of type #section1#--->
<cfa_contentObjectGetMultiple
dataSource="suntimes"
typeID="#section1#"
r_stObjects="section1"
>
<!---Display the category of #section1--->
<p><font face="Arial"
color="#headlinecolor#"><h2>#section1.Category#</h2></font></p>
<p>
<!---display the objects with the method teaser--->
<cfa_contentObject
dataSource="suntimes"
lObjectIDs="#section1.objectid#"
stObjects="#section1#"
method="teaser"
>
As you can see from the error, I run into problems when it tries to evaluate
#section1.Category#. What I would like to do here is display the Category
name once. First, is there a way to refer to the first object in a
structure? If so, is it similar to how you refer to the first element of an
array? Second, am I even referring to it correctly? Third, am I not setting
up contentObjectGetMultiple correctly (and also contentObject). When I
comment out the #section1.Category# line, the error proceeds with the
lObjectIDs="#section1.objectid#. It's the same error except where
#section1.Category# is, #section1.objectid# takes its place.
This is the first time I have used contentObjectGetMultiple so I am a little
uncertain as to how to write it since I haven't found many examples on it.
Thanks for your help,
Laura
----- Original Message -----
From: "Raymond Camden" <[EMAIL PROTECTED]>
To: "Spectra-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, February 01, 2001 3:51 PM
Subject: RE: Need Help With Displaying Objects
> See contentObjectGetMultiple. Just provide the typeID and it will get all
> objects of a certain type.
>
> As for displaying all of them, use contentObject and pass all the IDs to
it
> and the name of the method to use. This will be better than CFLOOPing over
> the objects.
>
> Of course, I'm assuming you want to call some kind of display method. If
you
> just want to show the label or some such, then just use CFLOOP.
>
> =======================================================================
> Raymond Camden, Principal Spectra Compliance Engineer for Allaire
>
> Email : [EMAIL PROTECTED]
> ICQ UIN : 3679482
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
> > -----Original Message-----
> > From: Laura McReynolds [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 01, 2001 4:40 PM
> > To: Spectra-Talk
> > Subject: Need Help With Displaying Objects
> >
> >
> > Hello -
> >
> > I would like to display objects of a certain type on a page
> > without using a
> > container. For example, I have an Object Type called "NewsArticle" and I
> > want to be able to display all objects of that type.
> >
> > Is there a Spectra tag that fetches objects of a certain type? If so,
what
> > is it and what is the best way to display the objects. I'd just
> > like to do a
> > simple CFLOOP with the results.
> >
> > Thanks a lot,
> > Laura
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.