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

Cfgrid html and href

New Here ,
May 09, 2008 May 09, 2008
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.

TOPICS
Advanced techniques
295
Translate
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 ,
May 09, 2008 May 09, 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/
Translate
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
New Here ,
May 10, 2008 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
Translate
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 ,
May 10, 2008 May 10, 2008
LATEST
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/
Translate
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