0 Replies Latest reply on May 3, 2006 8:10 PM by 539E

    cffunction & cfreturn

    539E
      First, has anyone used BlogCFC? this is dealing with it.
      I have put parts of the pods and main content into iframes.
      I now need every link to escape & target the top.
      I have a problem with this code it seems...
      quote:

      <cfoutput><a href="#application.blog.makeLink(id)#" target="_top">#title#</a><br></cfoutput>

      And then in the blog.cfc file I find....
      quote:

      <cffunction name="makeLink" access="public" returnType="string" output="false"
      hint="Generates links for an entry.">
      <cfargument name="entryid" type="uuid" required="true">
      <cfset var q = "">
      <cfset var realdate = "">

      <cfquery name="q" datasource="#instance.dsn#">
      select posted, alias
      from tblblogentries
      where id = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.entryid#" maxlength="35">
      </cfquery>

      <cfif q.alias is not "">
      <cfset realdate = dateAdd("h", instance.offset, q.posted)>
      <cfreturn "#instance.blogURL#/#year(realdate)#/#month(realdate)#/#day(realdate)#/#q.alias#">
      <cfelse>
      <cfreturn "#instance.blogURL#?mode=entry&entry=#arguments.entryid#">
      </cfif>
      </cffunction>


      Does anyone see from this why target="_top" does not work?
      And am I missing the actual creation of makeLink?
      seems like the cffunction just is getting the query for it.
      I don't deal with cffunctions.