I want an image showcase with links to the subpages for Services, a different one for Projects, and a different one for Team. When I try to make a new image carousel, say for Services, it just fetches links and images from the original Projects subpages and not from the Services subpages. I made a new template for Services but when I look at the code, I don’t see what to edit, here it is below:
<?php snippet('header') ?>
<?php snippet('intro') ?>
<div class="content-container">
<?php
// Select what type of content you'd like to display
$projects = page('services')->children()->visible()->sortBy('manually')->paginate( (int)(string)$site->paginationServices() );
$pagination = $items->pagination();
// Select the listing view you'd like to use
snippet('listing-thumbs',[ 'items' => $items ]);
?>
<div class="wrap">
<?php snippet('pagination', [ 'pagination' => $pagination ]); ?>
</div>
</div>
<?php snippet('footer') ?>
You define $projectsin the first line here, but then you all of a sudden call the pagination method on a non-defined $items variable, which you later send to the snippet.
I changed the first appearance of $projects back to $items. Still having the same issue, where the Projects subpages appear on the Services page where I actually want the Services subpages to appear.
I think I’m not quite getting it. Are you using this same template for different pages? If you always call page('services') then you will always only get the children of that page.
So, let’s start from the beginning: Do you want all these different showcases on the same page? Or each on their own page?
The code above is all from the services.php template, the services page has its own content .txt file name separate from the projects. The snippet I’m calling is accordian.php which I understand as the image carousel thing- when I look at it, I do not see any defined pages. I’m not a coder and just using the kirby kollapse template. What do you mean by collection?
Could you just zip your project and upload it to some cloud storage, then send me a PM with a link to it. Doesn’t seem to have much sense to sort it out without actually seeing what is happening.