1

Im currently busy with working on a website but I got stuck. The site is running on Processwire and working with the FeatherLight lightbox.

Now the strange thing is, I am only able to see the images when I'm logged in as admin. When I'm just a guest (incognito) the site won't show these images but shows the other pages.

You can find the website over here

I've looked at the page settings in the CMS, and the guest is able to view the pages, as it also does with the text pages.

But I can't figure out how to get the images back.

Here is the code

<div id="container">
    <div class="grid-sizer"></div>
    <?php if ($page->numChildren(true)) {
        echo "<ul class='project'>";
        foreach ($page->children as $childIndex => $child) {
            if ($child->head_image) {
                $image = $child->head_image;
                echo "<li class='item'><a href='#' data-featherlight='#mylightbox" . $childIndex . "'><img id='mylightbox" . $childIndex . "' src='{$image->url}' class='image'></a></li>";
            }
        }
        echo "</ul>";
    }
    ?>
    <style>
        .featherlight-content:after {
            content: "<?php echo nl2br($child->title); ?> <?php echo nl2br($child->image_description); ?> <?php echo $child->formaat; ?>";
        }
    </style>

Thanks in advance!

Bugs
  • 4,491
  • 9
  • 32
  • 41
YouGo
  • 69
  • 9
  • you have an empty `
      ` in your DOM, which means that either `$page->children` is empty or `$child->head_image` does not evaluate to true.
      – masterfloda Jun 30 '17 at 23:23
    • @masterfloda Thanks for your reaction! How can it be that when I'm logged in it's not empty? Only when I view as guest. I tried to make some changes in the code and page children but it won't work out. – YouGo Jul 01 '17 at 07:16
    • Please post solutions as answers not as updates to your question. You can then accept the answer and that will tell others that it's solved so you also don't need to add _solved_ to the title. This will help future visitors and avoid confusion. Thank you. – Bugs Jul 01 '17 at 13:14
    • @YouGo I just wanted to point out that your issue does not seem to be with your code but with the visibility settings in your CMS. I'm not familiar with Processwire, so I'm afraid I can't help you there. Does this CMS has something like a Debug mode or a log that might help you with debugging? – masterfloda Jul 05 '17 at 17:57

    0 Answers0