Option Template in List Page

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.

Option Template in List Page

Postby mpol_ch » Mon Jan 08, 2018 3:28 am

Hi,

I am using the following code in "Option template" for lookup table and it works good for modal seach:

<span class="text-info">{{:df1}}</span> <small class="text-muted"><img src="files_file_bv.php?Id={{:lf}}" alt="" height="60" width="200"></small>

But it my main table I can not see the image in xxlist.php.
I am using the following code in main table

HREF field: Foto (Id of the BLOB image it is also lookup linked field=
Original field value: checked
Prefix: files_file_bv.php?Id=

What am I doing wrong here?

mpol_ch
mpol_ch
 
Posts: 584
Joined: Mon Nov 26, 2012 9:56 pm

Re: show BLOB image by selecting id using dropdown

Postby arbei » Mon Jan 08, 2018 1:33 pm

Option template is for Edit Tag only, you need to update the ViewValue as an image tag in Row_Rendered Server Event then try again.

For example:
$this-><Field>->ViewValue = "<img src='files_file_bv.php?Id=" . $this-><Field>->CurrentValue . "'>";
arbei
 
Posts: 1490
Joined: Wed Sep 09, 2015 10:13 am

Re: Option Template in List Page

Postby mpol_ch » Mon Jan 08, 2018 5:48 pm

Hi,

thank you. I am using the follwing code and it is doing the work.
Could you please advice how to have a pop-up windows onclick event for this image?

if ($this->Foto->ViewValue <> ""){
$this->Foto->ViewValue = "<img src='files_file_bv.php?Id=" . $this->Foto->CurrentValue . "' height='20' width='80'>";
}
else{
}

mpol_ch
mpol_ch
 
Posts: 584
Joined: Mon Nov 26, 2012 9:56 pm

Re: Option Template in List Page

Postby arbei » Tue Jan 09, 2018 12:02 pm

Add an A tag to the ViewValue, if you need to show the image in color box, add the corresponding class to the control with referencing the other image of the generated files.

For example:
$this-><Field>->ViewValue = "<a class='ewLightbox cboxElement' href='logo.png'><img src='logo.png'></a>";
arbei
 
Posts: 1490
Joined: Wed Sep 09, 2015 10:13 am

Re: Option Template in List Page

Postby mpol_ch » Tue Jan 09, 2018 6:57 pm

thanks a lot.
It works perfectly with the following code:

if ($this->Foto->ViewValue <> ""){
$this->Foto->ViewValue = "<a class='ewLightbox cboxElement' href='files_file_bv.php?Id=" . $this->Foto->CurrentValue . "'><img src='files_file_bv.php?Id=" . $this->Foto->CurrentValue . "' height='20' width='80'></a>";
}
else{
}

mpol_ch
mpol_ch
 
Posts: 584
Joined: Mon Nov 26, 2012 9:56 pm


Return to General Discussion (PHPMaker)



cron