# Setup Fotorama with alternative folder for full images

**URL:** <https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450>\
**Category:** Questions\
**Tags:** v2\
**Created:** [January 29, 2017, 8:48pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450 "2017-01-29T20:48:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiosirna](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fabiosirna/32/3092_2.png) [@fabiosirna](https://forum.getkirby.com/u/fabiosirna)\
**Post date:** [January 29, 2017, 8:48pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/1 "2017-01-29T20:48:05Z")

</div>

Hi there,  
I’m using Fotorama for display a gallery of images and I need to get the images in the folder _…/full_ of the project dir (the one that contains the full images).

```
  <?php foreach($page->images()->sortBy('sort', 'asc') as $image): ?>
    <div class="fotorama">
      <a href="<?php echo $image->url() ?>" 
          data-caption="<?php echo html($image->caption()) ?> <?php echo html($image->photographer()) ?>" 
          data-full="URL OF THE FOLDER THAT CONTAINS FULL IMAGES"></a>
    </div>
  <?php endforeach ?>

```

Here below the folder structure:

```
~/Sites/landscapestories/content/0-home/000_test
.
├── Schink_01.jpg
├── Schink_01.jpg.txt
├── ...
├── Schink_20.jpg
├── full
│ ├── Schink_01.jpg
│ ├──...
│ └── Schink_20.jpg
└── project.en.txt

```

How can I get the url of the corresponding image in the folder _full_?

Thanks,  
Fabio

---

<div class="post-metadata">

**Author:** ![jbeyerstedt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jbeyerstedt/32/3976_2.png) [@jbeyerstedt](https://forum.getkirby.com/u/jbeyerstedt)\
**Post date:** [January 29, 2017, 9:08pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/2 "2017-01-29T21:08:43Z")

</div>

The url of the folder should be

```auto
<?php echo $site->url() . "/" . $page->uri() . "/full" ?>

```

The full url of the file can be returned by adding the filename to the path

```auto
$page->images()->first()->filename()

```

so the full php code should be

```auto
<?php echo $site->url() . "/" . $page->uri() . "/full/" . $page->images()->first()->filename() ?>

```

---

<div class="post-metadata">

**Author:** ![fabiosirna](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fabiosirna/32/3092_2.png) [@fabiosirna](https://forum.getkirby.com/u/fabiosirna)\
**Post date:** [January 29, 2017, 9:17pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/3 "2017-01-29T21:17:28Z")

</div>

> [@jbeyerstedt](#):
>
> \<?php echo $site-\>url() . “/” . $page-\>uri() . “/full/” . $page-\>images()-\>first()-\>filename() ?\>

Thanks, but doesn’t works ☹ Here the output:

```
 <div class="fotorama">
      <a href="http://localhost/~fabio/landscapestories/content/0-home/000_test_resize/Schink_01.jpg" 
          data-caption="9/17/2006, 8:45 am &ndash; 9:45 am, N 78&deg;13.370' E 015&deg;40.024' Hans-Christian Schink" 
          data-full="http://localhost/~fabio/landscapestories/home/000_test_resize/full/Schink_01.jpg"></a>
    </div>
      <div class="fotorama">
      <a href="http://localhost/~fabio/landscapestories/content/0-home/000_test_resize/Schink_02.jpg" 
          data-caption=" " 
          data-full="http://localhost/~fabio/landscapestories/home/000_test_resize/full/Schink_01.jpg"></a>
    </div>
      <div class="fotorama">
      <a href="http://localhost/~fabio/landscapestories/content/0-home/000_test_resize/Schink_03.jpg" 
          data-caption=" " 
          data-full="http://localhost/~fabio/landscapestories/home/000_test_resize/full/Schink_01.jpg"></a>
    </div> 

```

As you can see the path is not correct and the image is always 01.jpg.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 29, 2017, 9:30pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/4 "2017-01-29T21:30:04Z")

</div>

Try this:

```auto
<?php echo $site->url() . '/content/' . $page->diruri(). "/full/" . $image->filename(); ?>

```

---

<div class="post-metadata">

**Author:** ![fabiosirna](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fabiosirna/32/3092_2.png) [@fabiosirna](https://forum.getkirby.com/u/fabiosirna)\
**Post date:** [January 29, 2017, 9:33pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/5 "2017-01-29T21:33:29Z")

</div>

> [@texnixe](#):
>
> \<?php echo echo $site-\>url() . ‘/content/’ . $page-\>diruri(). “/full/” . $image-\>filename(); ?\>

I got this error:

```
Whoops\Exception\ErrorException thrown with message "parse error"

Stacktrace:
#0 Whoops\Exception\ErrorException in /Users/fabio/Sites/landscapestories/site/templates/project.php:34

```

---

<div class="post-metadata">

**Author:** ![fabiosirna](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fabiosirna/32/3092_2.png) [@fabiosirna](https://forum.getkirby.com/u/fabiosirna)\
**Post date:** [January 29, 2017, 9:35pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/6 "2017-01-29T21:35:11Z")

</div>

Ok, got it.

There is double echo 🙂

This is the correct one:

```
<?php echo $site->url() . '/content/' . $page->diruri(). "/full/" . $image->filename(); ?>
```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 29, 2017, 9:37pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/7 "2017-01-29T21:37:52Z")

</div>

Oops, sorry don’t know how that got there 😊

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:52pm UTC](https://forum.getkirby.com/t/setup-fotorama-with-alternative-folder-for-full-images/6450/9 "2025-02-06T16:52:53Z")

</div>


