Hi all!
Wondering if/how it would be possible to build a clickable-link from data entered into a column. For example - a website lists its content by ID, and their links are in the format http://www.website.com/ID (ID being a 6 digit number).
I have a column in my table for "Website ID" where users can enter the 6 digit number, and it obviously displays as plain text.
Is there any way I could pre-build the URL and append the ID behind the scenes, turning the 6 digit number into a hyperlink which would take users to http://www.website.com/123456? (or whatever they'd put into the "Website ID" field).
Any thoughts would be much appreciated!
Cheers,
TNL.
Custom URL built from value in column
-
- Veteran Member
- Posts: 67
- Joined: 2015-06-06 12:10
Re: Custom URL built from value in column
First off - what version of AppGini are you using.
Is the link to take them to another record in your database app or could it take them to some totally unrelated website?
Alan
Is the link to take them to another record in your database app or could it take them to some totally unrelated website?
Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -
-
- Veteran Member
- Posts: 67
- Joined: 2015-06-06 12:10
Re: Custom URL built from value in column
Hi Alan,
I'm on 5.40.
The link is to an unrelated website, always in the format of http://www.url.com/site/123456 - the 123456 coming from a column in my db.
I stumbled upon this post - http://forums.appgini.com/phpbb/viewtop ... f=4&t=1524 - which, if I'm reading it correctly, is doing much the same as I intend to. Hardcode the first part of the URL in the detail view, retrieve the relevant column value and append it.
Although I'm not clear on which .php file builds the detail view (going out on a limb here, perhaps the _view.php file?) or how it would select and display the corresponding record for the row currently being viewed.
I may have misinterpreted patsd102's post, and if so, please let me know so I'm not barking up the wrong tree!
Cheers,
Ally
I'm on 5.40.
The link is to an unrelated website, always in the format of http://www.url.com/site/123456 - the 123456 coming from a column in my db.
I stumbled upon this post - http://forums.appgini.com/phpbb/viewtop ... f=4&t=1524 - which, if I'm reading it correctly, is doing much the same as I intend to. Hardcode the first part of the URL in the detail view, retrieve the relevant column value and append it.
Although I'm not clear on which .php file builds the detail view (going out on a limb here, perhaps the _view.php file?) or how it would select and display the corresponding record for the row currently being viewed.
I may have misinterpreted patsd102's post, and if so, please let me know so I'm not barking up the wrong tree!
Cheers,
Ally
Re: Custom URL built from value in column
HI friend,
This is my line of code on the template TV.html page (activations)
<td id="Activations-date-<%%VALUE(id)%%>" class="Activations-date "><%%SELECT%%><%%VALUE(date)%%><%%ENDSELECT%%></td>
<td id="Activations-act-<%%VALUE(id)%%>" class="Activations-act "><a href="http://www.qrz11.com/show_prof.php?call ... VALUE(act)%%>" target="_blank"><%%VALUE(act)%%></td>
<td id="Activations-log-<%%VALUE(id)%%>" class="Activations-log "><a href="http://www.qrz11.com/show_prof.php?call ... VALUE(log)%%>" target="_blank"><%%VALUE(log)%%></td>
First line is %select% opens to detail page
Second opens to a second site called QRZ11.com (act field) input
Third is same (log field)
Target - blank is to open to a new tab
This is the line you need to replace for your own site. (http://www.qrz11.com/show_prof.php?callsign=)
And change the field name to your site as well,
I hope this helps,
My page = http://activations.dx27.net/Activations_view.php
Pat
This is my line of code on the template TV.html page (activations)
<td id="Activations-date-<%%VALUE(id)%%>" class="Activations-date "><%%SELECT%%><%%VALUE(date)%%><%%ENDSELECT%%></td>
<td id="Activations-act-<%%VALUE(id)%%>" class="Activations-act "><a href="http://www.qrz11.com/show_prof.php?call ... VALUE(act)%%>" target="_blank"><%%VALUE(act)%%></td>
<td id="Activations-log-<%%VALUE(id)%%>" class="Activations-log "><a href="http://www.qrz11.com/show_prof.php?call ... VALUE(log)%%>" target="_blank"><%%VALUE(log)%%></td>
First line is %select% opens to detail page
Second opens to a second site called QRZ11.com (act field) input
Third is same (log field)
Target - blank is to open to a new tab
This is the line you need to replace for your own site. (http://www.qrz11.com/show_prof.php?callsign=)
And change the field name to your site as well,
I hope this helps,
My page = http://activations.dx27.net/Activations_view.php
Pat
23.17
-
- Veteran Member
- Posts: 67
- Joined: 2015-06-06 12:10
Re: Custom URL built from value in column
Fantastic! Got it working in 2 minutes in the table view, with your example!
When a guest user logs into the site and selects something from the table view, they see the Detail View, which also has this field in plain text - that's my next port-of-call for this, making that into a link also. I shall fiddle, now that I know what I'm looking for.
Many thanks again - and nice background by the way!
When a guest user logs into the site and selects something from the table view, they see the Detail View, which also has this field in plain text - that's my next port-of-call for this, making that into a link also. I shall fiddle, now that I know what I'm looking for.
Many thanks again - and nice background by the way!
Re: Custom URL built from value in column
Glad I could be of help.
Thanks for your comment about my background.
To add your own background, go your your theme css page. (i use cosmo)
Find the .body line and replace with this.
body {
font-family: "Open Sans", Calibri, Candara, Arial, sans-serif;
font-size: 15px;
line-height: 1.428571429;
color: #333333;
background-image: url(http://yourlinktoimage.jpg);
background-size: 100% 100%;
background-attachment: fixed;
background-position: center;
}
Cheers
pat
Thanks for your comment about my background.
To add your own background, go your your theme css page. (i use cosmo)
Find the .body line and replace with this.
body {
font-family: "Open Sans", Calibri, Candara, Arial, sans-serif;
font-size: 15px;
line-height: 1.428571429;
color: #333333;
background-image: url(http://yourlinktoimage.jpg);
background-size: 100% 100%;
background-attachment: fixed;
background-position: center;
}
Cheers
pat
23.17
-
- Veteran Member
- Posts: 67
- Joined: 2015-06-06 12:10
Re: Custom URL built from value in column
Thanks. Is that for a Global background image? I put different background images on my login, sign-up, forgot password, main, etc pages by adding the usual;
<style>
body
{
background-image: url blah blah blah
}
...
On each relevant page. Seems to work and not break anything!
<style>
body
{
background-image: url blah blah blah
}
...
On each relevant page. Seems to work and not break anything!