Fórumok

How to get full image path from image id?

Mihael Palfi, módosítva 13 év-val korábban

How to get full image path from image id?

New Member Bejegyzések: 20 Csatlakozás dátuma: 2010.11.05. Legújabb bejegyzések
Hello

Im trying to implement a simple image previewer, so that when we click on an thumbnail the image is shown on whole screan (Like LightBox). But i have a small problem with the image paths.

I made structure for user adding some text, multiple images and a template for handling my display data and the effects.

Here is the code from the template:


#foreach ($singleImage in $image.getSiblings())

<span id="wrapper">
<a href="$singleImage.GetData()" rel="effect">
<img border="1px" src="$singleImage.GetData()" alt="picture">
</a>
</span>

#end



Problem with line : <a href="$singleImage.GetData()" rel="effect">

When i put the full image path in href like /theme/custom/Image1.png then it works perfect but whit $singleImage.GetData() the full screan preview dosent work becose it looks for the image by id.

So the questions

1. is it posible to get the full image path and file name from the id that is added in the href?

2. any other solutions?


thanks for the help

Miha
thumbnail
Mohammed Azam, módosítva 13 év-val korábban

RE: How to get full image path from image id?

Regular Member Bejegyzések: 159 Csatlakozás dátuma: 2009.11.06. Legújabb bejegyzések
Mihael Palfi:
Hello

Im trying to implement a simple image previewer, so that when we click on an thumbnail the image is shown on whole screan (Like LightBox). But i have a small problem with the image paths.

I made structure for user adding some text, multiple images and a template for handling my display data and the effects.

Here is the code from the template:


#foreach ($singleImage in $image.getSiblings())

<span id="wrapper">
<a href="$singleImage.GetData()" rel="effect">
<img border="1px" src="$singleImage.GetData()" alt="picture">
</a>
</span>

#end



Problem with line : <a href="$singleImage.GetData()" rel="effect">

When i put the full image path in href like /theme/custom/Image1.png then it works perfect but whit $singleImage.GetData() the full screan preview dosent work becose it looks for the image by id.

So the questions

1. is it posible to get the full image path and file name from the id that is added in the href?

2. any other solutions?


thanks for the help

Miha



I think the VM variables/methods are case sensitive

you need to replace

$singleImage.GetData() to $singleImage.getData()
Mihael Palfi, módosítva 13 év-val korábban

RE: How to get full image path from image id?

New Member Bejegyzések: 20 Csatlakozás dátuma: 2010.11.05. Legújabb bejegyzések
Hi

I found out what was wrong. It was not a problem of hyperlink beeing show as "src="/image/journal/article?img_id=25352&t=1292850280122" with id.

But my custom image popup window jquery script required an option field that this link is an image.

Thanks for the help anyway