Skip to main content
Participant
May 9, 2008
Question

Cfgrid html and href

  • May 9, 2008
  • 3 replies
  • 319 views
Hello All,

I am using cfgrid Format=HTML. I have no problem with populating the grid from a query. My problem comes from
the href text box in the grid. I have a variable name like the following:

/l/listing/tag/#gettopcat.categoryName#.html

Where categoryName is the name of the column being populated. I have around 40 items in the grid list but the only
href that works properly is the first item in the grid. Every item in the grid goes to the href for the first item in the grid.

Is this possible with cfgrid?

Can anyone point me to a better solution where I can have a grid with a vertical scroll and item as href items when I click I can get to the proper page?

Thanks.

This topic has been closed for replies.

3 replies

Inspiring
May 11, 2008
it's not strange at all. your href is not inside a cfloop or cfoutput,
so any reference to a query column will reference the first row only.

one thing you can do is add a column that contains the full href text to
your query, i.e.:

SELECT categoryID, categoryName, CONCAT('/l/listing/tag/', categoryName,
'.html') AS hreflink
FROM...

the above syntax is for MySQL, but your db will have its own CONCAT()
function equivalent.


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
lrsoreyAuthor
Participant
May 10, 2008
Hello Azadi,

Thanks for your response.

Unfortunately this did not work.

Variables are set from the query that populates the grid.

I am at a loss on what to do to make this work.

Strange that the href only can find the first item in the grid list.

lrsorey
Inspiring
May 10, 2008
where and how do you set your variable?

does changing it to
/l/listing/tag/#gettopcat.categoryName[gettopcat.currentrow]#.html help?


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/