Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Repeating image, that should only show once

Started by Joel Castillo Guerra 6 years ago · 5 replies · 439 views
6 years ago

Hey,
I'm using the latest grav version but I came across a problem. I made a page and in the admin panel I added one image and two audio clips to that page. The problem is that the single images is repeated twice. If i remove the second audio clip, the second image also disappears. This is the markdown file:

MARKDOWN
![](stip-leert-vliegen.png)

## Stip leert vliegen

![song01.m4a](song01.m4a)

## Tak op de weg

![song02.m4a](song02.m4a)

And this is how it looks in the browser (zoomed out):
image|690x375

I tried removing all CSS, but that didn't change a thing.

This is the twig template:

TWIG
{% extends 'partials/base.html.twig' %}
{% block stylesheets %}
    {{ parent() }}
    {% do assets.addCss('theme://css/stylesheetliedjes.css') %}
    {{ assets.css() }} 
{% endblock %}
{% block content %}

    {{ page.content }}

{% endblock %}

This is (partly) base.html.twig:

TWIG
<div id="content"> {% block content %}{% endblock %}</div>

Thanks for helping!

6 years ago

@joelcastillo, A few things I noticed:

  • It looks like the image is a single large image with 2 ladybugs. It is probably a background image of the container containing the two audio controls.
    When audio-2 is deleted, the lower half of the image disappears/clipped because its container is cut in half.
  • I also see something suspicious in your Twig: The expression {{ assets.css() }} inside the stylesheets block.
    I wonder if {{ assets.css() }} also occurs in a separate block {% block assets deferred %} inside base.html.twig (as in Quark). In that case, your css is added twice. (I suspect that will not be the cause of your issue though)
last edited 04/25/20 by pamtbaau
6 years ago

Thanks for the help! It's actually a background image of the clouds. The ladybug is a separate image ().

6 years ago

@joelcastillo, Would have been useful to know upfront... Instead of more guessing, would you mind sharing the site's url?

6 years ago

@joelcastillo, You may zip the relevant parts inside the /user folder and direct mail me...

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 57 15 hours ago
Support · by Anna, 3 days ago
2 65 18 hours ago
Support · by Justin Young, 18 hours ago
1 33 18 hours ago
Support · by Duc , 1 week ago
2 68 5 days ago
Support · by Colin Hume, 1 week ago
2 60 6 days ago