Setting an URL on a Field
Setting an URL on a Field
Hi,
Is there a way to setup an URL on a field?
The case is:
Table Countries and a field named: Flag.
De flag is placed as an image on my server, however I can’t define this field as an "URL type.
Ron
Is there a way to setup an URL on a field?
The case is:
Table Countries and a field named: Flag.
De flag is placed as an image on my server, however I can’t define this field as an "URL type.
Ron
Re: Setting an URL on a Field
Hi,
Almost there ....
By marking the field (Flag) as Rich (HTML) area it is possible to place an URL.
The next step that I actually want is: Navigating from de Pop-Up screen to the desired location on the server (situated in the cloud).
(is it perhaps possible to place a "base address" like:
Ron
Almost there ....
By marking the field (Flag) as Rich (HTML) area it is possible to place an URL.
The next step that I actually want is: Navigating from de Pop-Up screen to the desired location on the server (situated in the cloud).
(is it perhaps possible to place a "base address" like:
Code: Select all
http://cloud.domain/Rootdirecory/SubDirectory/
- Attachments
-
- Appgini_Add_Link.PNG (12.84 KiB) Viewed 19408 times
Re: Setting an URL on a Field
Ron,
I am not sure if you want the same as I
do, but what I do is the following:
definition of the field 'Video' in the table: and the result in the detail form: When you have update / insert permissions you can insert the url.
When you have only a read permission, you can only click the icon.
The directpry 'instructions' is a subdirectory of the rootdirectory (same level as the 'hooks' and 'images')
When you click the icon the video starts in a new tab: Success,
I am not sure if you want the same as I
do, but what I do is the following:
definition of the field 'Video' in the table: and the result in the detail form: When you have update / insert permissions you can insert the url.
When you have only a read permission, you can only click the icon.
The directpry 'instructions' is a subdirectory of the rootdirectory (same level as the 'hooks' and 'images')
When you click the icon the video starts in a new tab: Success,
- Attachments
-
- instru.png (88.44 KiB) Viewed 19397 times
Bert
I am using Appgini 5.75
I am using Appgini 5.75
Re: Setting an URL on a Field
Hi Bertv,
Thanks for your answers.
This could be an option, it works for small files. (I mean not that many pictures)
I'm working with a database with > 80.000 pictures of ships. These pictures are "in the cloud", so on a separate server as the AppGini files. Is it possible to change the name to the name of the cloud server in the Behavior" option?
Ron
Thanks for your answers.
This could be an option, it works for small files. (I mean not that many pictures)
I'm working with a database with > 80.000 pictures of ships. These pictures are "in the cloud", so on a separate server as the AppGini files. Is it possible to change the name to the name of the cloud server in the Behavior" option?
Ron
Re: Setting an URL on a Field
Hi There,
Any (more) suggestions?
Ron
Any (more) suggestions?
Ron
Re: Setting an URL on a Field
So would you like to have a base address? maybe you could write some code in the before_insert hook of your table with something like this:
So everytime you insert a new row you should just put the name of the file in the cloud server and it automatically writes on DB with the full address. Hope this helps or let me know if I'm misunderstanding.
Code: Select all
function myTable_before_insert(&$data, $memberInfo, &$args){
// Set base address
$baseAddress = 'http://cloud.domain/Rootdirecory/SubDirectory/';
//Concatenate with the value given
$data['myField'] = $baseAddress . $data['myField'];
return TRUE;
}
Re: Setting an URL on a Field
Hi scampoli,
Thanks for your input. It might work however....
If I put this code:
Then I don't see any difference. I do something wrong I think.
Do I have to alter a "field" defenition?
Ron
Thanks for your input. It might work however....
If I put this code:
Code: Select all
function landen_before_insert(&$data, $memberInfo, &$args){
// Set base address
$baseAddress = 'http://cloud.domain/Rootdirecory/SubDirectory/';
//Concatenate with the value given
$data['myField'] = $baseAddress . $data['myField'];
return TRUE;
}
Do I have to alter a "field" defenition?
Ron
- Attachments
-
- Back End
- Land_1.PNG (173.16 KiB) Viewed 19307 times
-
- Front End
- Land.PNG (27.22 KiB) Viewed 19307 times
Re: Setting an URL on a Field
I think you should replace this line
with the name of your field, something like this:
Code: Select all
$data['myField'] = $baseAddress . $data['myField'];
Code: Select all
$data['Vlag'] = $baseAddress . $data['Vlag];
Re: Setting an URL on a Field
Hi scampollo.
That was stupid of me, sorry.
I've changed it but the result is still the same.
The URL is not set, I still have to type it.
Hereby the generated HTML-code. (This is the code after I've opened the "link" attribute.
Ron
That was stupid of me, sorry.
I've changed it but the result is still the same.
The URL is not set, I still have to type it.
Hereby the generated HTML-code. (This is the code after I've opened the "link" attribute.
Code: Select all
<div class="form-group">
<label for="Vlag" class="control-label col-lg-3">Vlag</label>
<div class="col-lg-9">
<p class="form-control-static">
<a id="Vlag-link" href="link.php?t=landen&f=Vlag&i=99" target="_blank"></a>
<label for="Vlag"><button type="button" id="Vlag-edit-link" class="btn btn-default hspacer-lg vspacer-sm" data-toggle="collapse" data-target="#Vlag" title="Wijzigen"><i class="glyphicon glyphicon-pencil"></i></button></label>
</p>
Re: Setting an URL on a Field
Try this in your TempleTV.html file
<td id="your-table-<%%VALUE(yourtable)%%>" class="field_log-Name "><a href="http://www.your url php?=<%%VALUE(table)%%>" target="_blank"><%%VALUE(table)%%></a></td>
(Make sure to back up your file first)
<td id="your-table-<%%VALUE(yourtable)%%>" class="field_log-Name "><a href="http://www.your url php?=<%%VALUE(table)%%>" target="_blank"><%%VALUE(table)%%></a></td>
(Make sure to back up your file first)
23.17
Re: Setting an URL on a Field
Hi patsd102,
Sorry for reacting so late, I've missed your mail or so.
I've put your suggested code into the file.
Hower, now resulst. Did I put it at the rigth place? Did I substitute the rigth names.
My knowledge of PHP is verry poor
The table is named: Landen and the field is landen.vlag.
The code is: (see first line)
Sorry for reacting so late, I've missed your mail or so.
I've put your suggested code into the file.
Hower, now resulst. Did I put it at the rigth place? Did I substitute the rigth names.
My knowledge of PHP is verry poor
The table is named: Landen and the field is landen.vlag.
The code is: (see first line)
Code: Select all
<td id="landen<%%VALUE(landen)%%>" class="field_log-Name "><a href="http://cloud.domain/Rootdirecory/SubDirectory/ php?=<%%VALUE(table)%%>" target="_blank"><%%VALUE(table)%%></a></td>
<td id="landen-Land-<%%VALUE(LandenID)%%>" class="landen-Land "><%%SELECT%%><%%VALUE(Land)%%><%%ENDSELECT%%></td>
<td id="landen-Vlag-<%%VALUE(LandenID)%%>" class="landen-Vlag "><a href="link.php?t=landen&f=Vlag&i=<%%VALUE(LandenID)%%>" target="_blank"><%%VALUE(Vlag)%%></a></td>
<td id="landen-Mutator-<%%VALUE(LandenID)%%>" class="landen-Mutator "><%%VALUE(Mutator)%%></td>
<td id="landen-Mutatiedatum-<%%VALUE(LandenID)%%>" class="landen-Mutatiedatum "><%%VALUE(Mutatiedatum)%%></td>
<script>jQuery(function(){ var e_Vlag='<%%VALUE(Vlag)%%>'; if(e_Vlag=='' || e_Vlag==' ') jQuery('#landen-Vlag-<%%VALUE(LandenID)%%>').html(''); });</script>
Re: Setting an URL on a Field
Hi patsd1102
The code is now: ( You gave: Flag, however the fieldname is : vlag (dutch for Flag)
I don't see any change.
Is the code on the right place, is the line at the right place? (It is now the first line)
Ron
The code is now: ( You gave: Flag, however the fieldname is : vlag (dutch for Flag)
Code: Select all
<td id="landen<%%VALUE(landen)%%>" class="field_log-Name "><a href="http://cloud.domain/Rootdirecory/SubDirectory/ .php?landen.vlag=<%%VALUE(table)%%>" target="_blank"><%%VALUE(table)%%></a></td>
Is the code on the right place, is the line at the right place? (It is now the first line)
Ron
- Attachments
-
- App.PNG (36.53 KiB) Viewed 19215 times
Re: Setting an URL on a Field
Have you an example of a uri you want to connect to,
http://cloud.domain/Rootdirecory/SubDirectory / mylink.html ?
http://cloud.domain/Rootdirecory/SubDirectory / mylink.html ?
23.17
Re: Setting an URL on a Field
Hello Patssd102,
For one reason I don't receive mails anymore after a response on a post. I have to ask why.
The "try example" is about Flags from Countries.
The main goal is to have an url build for Photos from ships, like this example:
However, the example url:
http://cloud.kraalmedia.nl/Shipphoto/Sh ... %20(1).jpg
What I realy like to have is:
Base address: http://cloud.kraalmedia.nl/Shipphoto/Ship/
Variable name photographer = name of the Photographer (Keizer)
Variable name alphabet = subdirectory (V)
Variable name minmax = subdirectory (min or max)
Variable name picture= filename (Verona%20Ridderkerk%20(1).jpg
Ron
For one reason I don't receive mails anymore after a response on a post. I have to ask why.
The "try example" is about Flags from Countries.
The main goal is to have an url build for Photos from ships, like this example:
However, the example url:
http://cloud.kraalmedia.nl/Shipphoto/Sh ... %20(1).jpg
What I realy like to have is:
Base address: http://cloud.kraalmedia.nl/Shipphoto/Ship/
Variable name photographer = name of the Photographer (Keizer)
Variable name alphabet = subdirectory (V)
Variable name minmax = subdirectory (min or max)
Variable name picture= filename (Verona%20Ridderkerk%20(1).jpg
Ron
Re: Setting an URL on a Field
Ron,
is this what you want as table view: and this as detail view: In this example are only tw fields for the link of the picture (url address and name picture).
- create the fields for the url adress, picture name and the picture as varchar fields. Define the picture as an image. After generating:
- add some code in the after-insert and after-update hook for inserting the full link to the picture into the table field of the picture: - change the tablename_templateDVand TV files; remove the <%%TRANSLATION(ImageFolder)%%>
Below the templateDV, but do the same in the TV template file - make a change in the thumbnail.php script. This script looks at the image-folder and create thumbnails if it is there.
In this case we don't want it. Add the code below after row 20 ($i=$_GET['i']; // original image file name)
// extra code for show picture in link
if(substr(strtoupper($i),0,5)=='HTTP:'){
$i=str_replace(' ', '%20', $i);
getImage($i);
exit;
}
Success,
is this what you want as table view: and this as detail view: In this example are only tw fields for the link of the picture (url address and name picture).
- create the fields for the url adress, picture name and the picture as varchar fields. Define the picture as an image. After generating:
- add some code in the after-insert and after-update hook for inserting the full link to the picture into the table field of the picture: - change the tablename_templateDVand TV files; remove the <%%TRANSLATION(ImageFolder)%%>
Below the templateDV, but do the same in the TV template file - make a change in the thumbnail.php script. This script looks at the image-folder and create thumbnails if it is there.
In this case we don't want it. Add the code below after row 20 ($i=$_GET['i']; // original image file name)
// extra code for show picture in link
if(substr(strtoupper($i),0,5)=='HTTP:'){
$i=str_replace(' ', '%20', $i);
getImage($i);
exit;
}
Success,
Bert
I am using Appgini 5.75
I am using Appgini 5.75
Re: Setting an URL on a Field
Hi bertv,
This is impressive, I'll look in to it and let you know, tomorrow, what your result brings me.
Ik heb het idee dat je Nederlander bent, kunnen we anders eens telefonisch verder kijken als het niet mocht lukken?
Ron
This is impressive, I'll look in to it and let you know, tomorrow, what your result brings me.
Ik heb het idee dat je Nederlander bent, kunnen we anders eens telefonisch verder kijken als het niet mocht lukken?
Ron
Re: Setting an URL on a Field
The given solution from Bertv was impressive and works, however it still is a lot of typing an url, every time you have to place a photo.
I can't figure out why the given solution of Patssd102 still doesn't work. It should work but I still not get a "base url" back, so what do I wrong.
I like to "set" the weblink address to a specific URL., where can I do this?
I've changed the landen_templateTV file, see code
I also changed, in landen.php
So what do I miss
Ron
I can't figure out why the given solution of Patssd102 still doesn't work. It should work but I still not get a "base url" back, so what do I wrong.
I like to "set" the weblink address to a specific URL., where can I do this?
I've changed the landen_templateTV file, see code
Code: Select all
<!-- Edit this file to change the layout of each record in the table view -->
<!-- To disable clicking of a field, remove the <%%select%%> and <%%endselect%%> formatters around it-->
<!-- If you wish to hide the table view header that contains the column titles, -->
<!-- open the generated 'landen_view.php' file in your text editor and -->
<!-- change the value of $x->ShowTableHeader to 0 -->
<td id="landen-<%%VALUE(landen)%%>" class="field_log-Name "><a href="http://cloud.kraalmedia.nl/Shipphoto/Ship/Vlaggen/ .php?=<%%VALUE(table)%%>" target="_blank"><%%VALUE(table)%%></a></td>
<td id="landen-land-<%%VALUE(landenid)%%>" class="landen-land "><%%SELECT%%><%%VALUE(land)%%><%%ENDSELECT%%></td>
<td id="landen-vlag-<%%VALUE(landenid)%%>" class="landen-vlag "><a href="<%%TRANSLATION(ImageFolder)%%><%%VALUE(vlag)%%>" rel="lightbox"><img src="thumbnail.php?i=<%%VALUE(vlag)%%>&t=landen&f=vlag&v=tv" class="img-thumbnail"></a></td>
<td id="landen-mutator-<%%VALUE(landenid)%%>" class="landen-mutator "><%%VALUE(mutator)%%></td>
<td id="landen-mutatiedatum-<%%VALUE(landenid)%%>" class="landen-mutatiedatum "><%%VALUE(mutatiedatum)%%></td>
<script>jQuery(function(){ var e_vlag='<%%VALUE(vlag)%%>'; if(e_vlag=='' || e_vlag==' ') jQuery('#landen-vlag-<%%VALUE(landenid)%%>').html(''); });</script>
Code: Select all
function landen_before_insert(&$data, $memberInfo, &$args){
// Set base address
$baseAddress = 'http://cloud.kraalmedia.nl/Shipphoto/Ship/Nl/I/im/';
//Concatenate with the value given
$data['vlag'] = $baseAddress . $data['vlag'];
return TRUE;
Ron
Re: Setting an URL on a Field
Would it not be easier to upload the flags to your server via your appgini page.
I use this page where I have 351 images loaded with search set to view the Country column.
http://prefixlist.dx27.net/dx27prefixlist_view.php
I use this page where I have 351 images loaded with search set to view the Country column.
http://prefixlist.dx27.net/dx27prefixlist_view.php
23.17
Re: Setting an URL on a Field
Yes, for the flags it will do. However his table is one of many. My Appgini project is about ships and photo's of them.
Right now there are 80.000 photo's to be displayed, using an Access database and shown by in ASP .
Look or an example: http://www.shipphoto.nl
So....if possible, I still want a solution.
Ron
Right now there are 80.000 photo's to be displayed, using an Access database and shown by in ASP .
Look or an example: http://www.shipphoto.nl
So....if possible, I still want a solution.
Ron
Re: Setting an URL on a Field
80,000 images. Thats a lot of images.
The URL was to link to each image,,
Sorry, I can't help further.
The URL was to link to each image,,
Sorry, I can't help further.
23.17
Re: Setting an URL on a Field
Hello Patssd102,
Thanks for trying to give me support / solutions.
Maybe someone else give me the solution.
Ron
Thanks for trying to give me support / solutions.
Maybe someone else give me the solution.
Ron
Re: Setting an URL on a Field
Hi Ron,
In my application, I needed to append the primary key of each record to a base URL and I wanted to be able to easily and instantly change the base URL (for example, this week I needed to change the url link for all records from 'http' to 'https'.) I also needed to be able to access this link from other places, not just the AppGini-generated application.
I created a MySQL View (similar to a Query in Access, I think) to build the link by concatenating the base url as a string to the primary key of the current record as a variable (you would probably use the image file name to complete the url in your application.)
After I had the link working properly for each record from the MySQL View results, I added the View as a table in AppGini with all fields set to read-only, and set the link behavior options for field that contained the calculated URL to be a Weblink that displayed the link as contents of another field, and finally linked that view/table as a child table linked by the primary key.
Once the view worked correctly in MySQL to build the complete link, there wasn't really anything special to do in AppGini - I just worked with it as if it was a regular table.
I'm not sure whether you can import queries from Access into AppGini as a table like you can with MySQL Views. If so, maybe a similar approach would work for you.
In my application, I needed to append the primary key of each record to a base URL and I wanted to be able to easily and instantly change the base URL (for example, this week I needed to change the url link for all records from 'http' to 'https'.) I also needed to be able to access this link from other places, not just the AppGini-generated application.
I created a MySQL View (similar to a Query in Access, I think) to build the link by concatenating the base url as a string to the primary key of the current record as a variable (you would probably use the image file name to complete the url in your application.)
After I had the link working properly for each record from the MySQL View results, I added the View as a table in AppGini with all fields set to read-only, and set the link behavior options for field that contained the calculated URL to be a Weblink that displayed the link as contents of another field, and finally linked that view/table as a child table linked by the primary key.
Once the view worked correctly in MySQL to build the complete link, there wasn't really anything special to do in AppGini - I just worked with it as if it was a regular table.
I'm not sure whether you can import queries from Access into AppGini as a table like you can with MySQL Views. If so, maybe a similar approach would work for you.
Re: Setting an URL on a Field
Hello Yvonnes,
Thanks for the suggestion. I'll try your approach.
Sorry for the late response, I was "out of the office" Later this week I'll work on your suggestion.
Ron
Thanks for the suggestion. I'll try your approach.
Sorry for the late response, I was "out of the office" Later this week I'll work on your suggestion.
Ron