• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need All Three Topics To Be Links

Guest
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

Hi, I have a webpage where I'm displaying the top three topics dscussed on the site, the way i want this set up is like this, to have the topics displayed on the page as a link to the secetion on the site where all the information on that topic is located..the problem im having is only the first of the three topics is getting linked, can anyone please help me out with this problem? this is some of my code:

<cfoutput query="get">
<a href="/news.cfm?n=#get.number#">
</cfoutput>
<cfoutput query="gettop">
#title#<br>
</a>
</cfoutput>


thanks in advanced...
TOPICS
Advanced techniques

Views

416

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

Is '#title#' part of 'gettop'?

Well, I'm thinking this so far:
<cfoutput query="get">
<a href="/news.cfm?n=#get.number#">
#get.title#<br>
</a>
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

typically i would do it like that as well but the thing is im calculating the top three using a different table thats why im using different queries: "get" and "gettop" what i dont understand is how it works fine but only for the first of the tree,which is weird...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

Perhaps the currentrow variable with cfoutput would be useful in this endevour.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

well im definitely willing to try it but inm not too familiar with how to work with a currentrow variable with cfoutput.... how would one go about doing this??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: WOLFcfm
well im definitely willing to try it but inm not too familiar with how to work with a currentrow variable with cfoutput.... how would one go about doing this??

Run this code and see if any light bulbs illuminate above your head.

assuming you are using cfoutput to display your query results,

<cfif currentrow lte 2>
anchor tag
<cfelse>
no anchor tag
</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 27, 2006 Jul 27, 2006

Copy link to clipboard

Copied

WOLFcfm wrote:
> well im definitely willing to try it but inm not too familiar with how to work with a currentrow variable with cfoutput.... how would one go about doing this??

If you have a query recordset: fooQuery.

And are looping over it with a cfoutput or cfloop.

<cfoutput query="fooQuery>
#fooQuery.currentRow# will be the row number of each iteration through
the loop.
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation