Hi,
I got a bilingual page (german and english) and some PDF downloads that are listed with this snippet
<div class="filelist-content">
<?php foreach($page->files() as $f) : ?>
<div class="file">
<div class="left-column">
<a title="<?php l::get('download_file') ?>" href="<?php echo $site->url().'/get/'.$f->filename() ?>" target="_blank">
<h2 id="<?php echo $f->name() ?>"><?php e($f->title()->empty(), $f->filename(), $f->title()->kirbytextRaw()); ?></h2>
<p class="file-info">
<?php e(!$f->title()->empty(), $f->filename().'<br>') ?>
<span class="filesize"><?php echo $f->niceSize(); ?></span><br>
</p>
</a>
</div>
<div class="right-column">
<?php echo $f->description()->kt(); ?>
</div>
</div>
<div class="clear-fix"></div>
<?php endforeach ?>
</div>
I.e. all files in the page folder are listed and the description is fetched from the file.pdf.en.txt
or file.pdf.de.txt
. Now I want to who only some files depending on the current language or different versions like file.de.pdf
and file.en.pdf
. Is there a built in way to do this?
If theres no build in way I guess I could create a custom filter but I don’t know how … so any help on that will be appreciated too!