Page 1 of 1
Setting an URL on a Field
Posted: 2015-02-28 13:49
by RonP
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
Re: Setting an URL on a Field
Posted: 2015-02-28 15:12
by RonP
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:
Code: Select all
http://cloud.domain/Rootdirecory/SubDirectory/
Ron
Re: Setting an URL on a Field
Posted: 2015-03-01 14:53
by Bertv
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:

- AppGini.png (65.74 KiB) Viewed 22616 times
and the result in the detail form:

- helpform.png (159 KiB) Viewed 22616 times
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:

- AppGini.png (65.74 KiB) Viewed 22616 times
Success,
Re: Setting an URL on a Field
Posted: 2015-03-03 10:45
by RonP
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
Re: Setting an URL on a Field
Posted: 2015-03-09 13:33
by RonP
Hi There,
Any (more) suggestions?
Ron
Re: Setting an URL on a Field
Posted: 2015-03-09 18:35
by scampollo
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:
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;
}
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.
Re: Setting an URL on a Field
Posted: 2015-03-10 16:14
by RonP
Hi scampoli,
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;
}
Then I don't see any difference. I do something wrong I think.
Do I have to alter a "field" defenition?
Ron
Re: Setting an URL on a Field
Posted: 2015-03-10 20:00
by scampollo
I think you should replace this line
Code: Select all
$data['myField'] = $baseAddress . $data['myField'];
with the name of your field, something like this:
Code: Select all
$data['Vlag'] = $baseAddress . $data['Vlag];
Re: Setting an URL on a Field
Posted: 2015-03-11 08:48
by RonP
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.
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>
Ron
Re: Setting an URL on a Field
Posted: 2015-03-14 21:02
by patsd102
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)
Re: Setting an URL on a Field
Posted: 2015-03-19 11:52
by RonP
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)
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
Posted: 2015-03-20 15:54
by patsd102
.php?flag=
try this,, to call up your field on your cloud.
Re: Setting an URL on a Field
Posted: 2015-03-20 16:39
by RonP
Hi patsd1102
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>
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
Re: Setting an URL on a Field
Posted: 2015-03-20 22:29
by patsd102
Have you an example of a uri you want to connect to,
http://cloud.domain/Rootdirecory/SubDirectory / mylink.html ?
Re: Setting an URL on a Field
Posted: 2015-03-21 10:27
by RonP
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)
V
ariable 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
Posted: 2015-03-21 17:55
by Bertv
Ron,
is this what you want as table view:

- table_view.png (75.1 KiB) Viewed 22415 times
and this as detail view:

- detail_view.png (51.06 KiB) Viewed 22415 times
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.

- appGini_fielddetails.png (125.7 KiB) Viewed 22415 times
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:

- hook_after_update.png (12.8 KiB) Viewed 22415 times
- change the tablename_templateDVand TV files; remove the <%%TRANSLATION(ImageFolder)%%>
Below the templateDV, but do the same in the TV template file

- templateDVhtml.png (13.01 KiB) Viewed 22415 times
- 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,
Re: Setting an URL on a Field
Posted: 2015-03-21 18:15
by RonP
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
Re: Setting an URL on a Field
Posted: 2015-04-18 11:11
by RonP
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
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>
I also changed, in landen.php
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;
So what do I miss
Ron

- Appgini-add-link-vlag.PNG (8.59 KiB) Viewed 22254 times

- Appgini-def-landen-vlag.PNG (81 KiB) Viewed 22254 times
Re: Setting an URL on a Field
Posted: 2015-04-19 13:29
by patsd102
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
Re: Setting an URL on a Field
Posted: 2015-04-19 14:28
by RonP
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
Re: Setting an URL on a Field
Posted: 2015-04-19 20:04
by patsd102
80,000 images. Thats a lot of images.
The URL was to link to each image,,
Sorry, I can't help further.
Re: Setting an URL on a Field
Posted: 2015-04-20 08:18
by RonP
Hello Patssd102,
Thanks for trying to give me support / solutions.
Maybe someone else give me the solution.
Ron
Re: Setting an URL on a Field
Posted: 2015-05-08 15:10
by yvonnes
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.
Re: Setting an URL on a Field
Posted: 2015-05-12 08:29
by RonP
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