Hi all,
New to CFFORM (flash) here - I"m creating an admin system for a
photogallery - I"m outputting thumbnails, with their captions into
rows, which are then editable.
What I need to do now is make the thumbnails into a link, so people
can view the full size image, but preferably, I want the link to have
a 'rel="lightbox"' attribute, so they'll open in lightbox.js.
I've already created the necessary html link, which I've put into
the query as a row, so each record has the necessary string, I'm just
foxed how to implement it. the href attribute obviously only works
for applets, so I'm a little stuck..
Ideas please?
Code below..
<!---Get Photos Recordset (returns
GalleryID,PhotoFileName,PhotoFormat,PhotoCaption,PhotoID--->
<cfinvoke component="components.managephotos" method="getcaptions"
returnvariable="Getphotos"></cfinvoke>
<cfscript>
//Set up the Query
OutputPhotos = QueryNew("thumbnail,id,Caption,larger",
"varchar,integer,varchar,varchar");
//Create Rows
QueryAddRow(OutputPhotos, GetPhotos.Recordcount);
</cfscript>
<cfset counter=1>
<cfloop query="GetPhotos">
<cfscript>
//Loop Adding contents to Q
QuerySetCell(OutputPhotos, "thumbnail",
"gallery_thumbnails/#GalleryID#/#PhotoFileName#.#PhotoFormat#",
counter);
QuerySetCell(OutputPhotos, "id", "#PhotoID#", counter);
QuerySetCell(OutputPhotos, "Caption", "#PhotoCaption#",
counter);
QuerySetCell(OutputPhotos, "larger", "<a
href=""../images/gallery_fullsize/#GalleryID#/
#PhotoFileName#.#PhotoFormat
#"" rel=""lightbox"">View</a>", counter);
</cfscript>
<cfset counter=counter+1>
</cfloop>
<!---Output Form--->
<cfform name="myform" height="500" width="750" format="Flash"
timeout="100" onload="formOnLoad()">
<cfformitem type="script">
function formOnLoad(){
myGrid.getColumnAt(1).labelFunction = setLabel;
}
function setLabel(item:Object, columnName:String): String {
if ( item[columnName] != undefined) {
return "../images/" + item[columnName];
}
else {
return "";
}
};
</cfformitem>
<cfgrid name="myGrid" rowHeight="74" rowheaders="false"
query="OutputPhotos" width="730" height="350" selectmode="edit">
<!---img Thumbnail--->
<cfgridcolumn name="thumbnail" type="image"
width="116" header="Photo" select="no" >
<!---Editable Caption Field--->
<cfgridcolumn name="caption" header="Caption" >
<!---Hidden ID field--->
<cfgridcolumn name="id" header="id" select="no"
width="50" display="no">
</cfgrid>
<cfinput type="submit" name="submit" value="submit">
</cfform>
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257972
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4