Option Template in List Page

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Option Template in List Page

Post by mpol_ch »

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


arbei
User
Posts: 9284

Post by arbei »

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 . "'>";


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

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


arbei
User
Posts: 9284

Post by arbei »

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>";


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

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


Post Reply