Create a special Link field to Launch Lightbox [resolved]

Talk about link fields or link implementations

Moderator: alexandrleonenko

dynsight
Expert
Expert
Posts: 99
Joined: Mar 3rd, '11, 03:05

Create a special Link field to Launch Lightbox [resolved]

Postby dynsight » Aug 30th, '11, 03:49

I want to launch a lightbox from a custom View field... I have tried several options and nothing works. The link needs to look like:

Code: Select all

 <a href="llview.php?I="{ID from DB} title="Lessons Learned Submission" rel="dmxLightbox" rev="{plugin:'url'}">View</a>


and I have tried many variations of"\

Code: Select all


$sql="select id,name,dateSubmitted ,lltitle, lessonsLearned, CONCAT(
  '<a title=\'Lessons Learned\' rel=\'dmxLightbox\' rev=\'{plugin:\'url\'}\' href=\"llview.php?i=\",CAST(id as CHAR),
  '>view</a>')
 as ViewField from LessonsLearned";


The viewsource shows the following

Code: Select all

SQL is:select id,name,dateSubmitted ,lltitle, lessonsLearned, CONCAT(
  '<a title=\'Lessons Learned\' rel=\'dmxLightbox\' rev=\'{plugin:\'url\'}\' href="llview.php?i=",CAST(id as CHAR),
  '>view</a>')


and the warnings are:
1) Wrong parameter in [id]: Check this field carefully, it may be not a Primary Key!
2) Field name, used in the list of fields in View Mode was not found in SELECT SQL! Please, check carefully your code syntax and field name, it may be case sensitive!
3) Field lltitle, used in the list of fields in View Mode was not found in SELECT SQL! Please, check carefully your code syntax and field name, it may be case sensitive!
4) Field lessonsLearned, used in the list of fields in View Mode was not found in SELECT SQL! Please, check carefully your code syntax and field name, it may be case sensitive!
5) Field ViewField, used in the list of fields in View Mode was not found in SELECT SQL! Please, check carefully your code syntax and field name, it may be case sensitive!


Now, the SQL statement does have the fields necessary (you can see it) but it does not seem to understand it as I have entered it
Last edited by dynsight on Aug 30th, '11, 11:56, edited 1 time in total.

dynsight
Expert
Expert
Posts: 99
Joined: Mar 3rd, '11, 03:05

Re: Create a special Link field to Launch Lightbox [Resolved]

Postby dynsight » Aug 30th, '11, 04:11

I resolved this by typing the sql statement directly into MYSQL CLI... I entered the SQL statement to figure out that I was missing a single quote. This is now a valid SQL statement

Code: Select all

 $sql="select id,name,dateSubmitted ,lltitle, lessonsLearned, CONCAT(
  '<a title=\'Lessons Learned\' rel=\'dmxLightbox\' rev=\"{plugin:\'url\'}\" href=\"llview.php?i=',CAST(id as CHAR),
  '\">view</a>')
 as ViewField from LessonsLearned";


The nearly finished page is here:

http://www.smoms.org/lldbgrid.php

lambro
Master
Master
Posts: 102
Joined: Sep 13th, '10, 14:31
Location: Metz, France

Re: Create a special Link field to Launch Lightbox [resolved]

Postby lambro » Aug 31st, '11, 06:02

I like the effect, it's nice!
However, accessing your website through Firefox 6 triggered a security alert. Keep up the good work!


Return to “Field type: "link"”