Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Media showing on the backround of my page

first-time

Solved by pamtbaau View solution

Started by Delo 2 years ago · 12 replies · 306 views
2 years ago

Hello,
Everytime i'm trying to use a modular page, the media i upload on the hero page appear on the backroung like this :
Sans titre|690x261

How to stop making it that?

2 years ago

Based on your specific question and considering all the provided info, aswer is really simple - don't upload media on the hero page.

Can't suggest more, because you didn't even mention what you want and what theme you're using

2 years ago

@Delo, As @Karmalakas mentioned, the information shared is insufficient. All we can do is guessing and we are bad at it... :-)

Here is my guess...
Considering your previous questions about the hero.html.twig template and the image you've shared, I guess you have been playing around with hero.html.twig and also css styles of theme Quark.

If so, it would be useful to share those changes and share a url to your site.
One note, please do not share screenshots of code snippets, but use text embedded in triple backticks.

2 years ago

Hello,
Sorry, I posted that a little late last night.
https://walbike.omlet.ovh/accueil-copy
I would like to have a page looking like the grav theme : https://getgrav.org/images/6/7/c/1/8/67c18dab9af77c5b734dbe327031ae577cdb70d3-themes-quark.jpg?g-f2241cdd

But I can't figurate out whats wrong with my code. It has been doing that even before i mess with the hero files:
Here's the /partials/hero.html.twig

TWIG
<section id="{{ id }}" class="section modular-hero hero {{ page.header.hero_classes }} {{ page.header.background.parallax ? 'parallax' : '' }}" {% if hero_image %}style="background-image: url('{{ hero_image.url }}');"{% endif %}>
    <div class="image-overlay"></div>
    <section class="container {{ grid_size }}" style="text-align: {{ page.header.hero_align|default('center') }}">
        {{ content|raw }}
    <section id="hero" class="modular-hero" style="margin-bottom: 0;">
    </section>
</section>

And the one in /modular :

TWIG
{% set grid_size = theme_var('grid-size') %}
{% set hero_image = page.header.hero_image ? page.media[page.header.hero_image] : page.media.images|first %}

{% include 'partials/hero.html.twig' %}

2 years ago

What's this empty section? What happens if you delete it?

@Delo:

TXT
    <section id="hero" class="modular-hero" style="margin-bottom: 0;">
    </section>

And there's also a missing </section> closing tag :backhand_index_pointing_left:

2 years ago

I added this because when i remove the middle button wich direct to the blog items on the bottom there is too much gap before my content and i cant figurate out how to close the gap neither.. :
Sans titre|690x456

This does nothing when i delete it

last edited 03/20/25 by Delo
2 years ago Delo I added the < /section > and it did nothing

Then why did the layout on your linked page change? I can clearly see it did something. And this additional empty section has no use at all. Just remove <i> from original and then play with CSS.

Also, don't know what your screenshot is of, but this is what I see:
image|378x500

2 years ago

OK, you posted an update just before I submitted my previous post.

@Delo:
it is still not looking good

I have no idea what you mean. How do you expect it to look? Resize the window and it will look different. You will have to crop your image before uploading to get different result

2 years ago Solution

@Delo, I'm sorry to say that I feel lost...

You talk about a modular and show an image of a modular and later you talk about a blog and show an image of a blog list...

Do you have two separate problems? One about modular and one about blog? Then please create two separate posts.

Update: Darn, I missed a couple of post before finishing this one...

Modular

This is how a modular page can look like using your hero image.
I'm using a fresh "Quark One-Page site" skeleton. All I changed is replacing the image in the 01._hero folder and updated hero.md with the name of the hero file and the title in the content.
{3B9D365E-D7F3-4791-9812-55F3C0E6D3C4}|604x382

last edited 03/20/25 by pamtbaau
2 years ago

@pamtbaau:
Quark One-Page site” skeleton.

Copied the grav skeleton just like you did and it worked easily. Don't know what's wrong but i'll start again by using this skeleton, thank you !!

Suggested topics

Topic Participants Replies Views Activity
Support · by complanar, 6 days ago
6 139 15 hours ago
Support · by Rick Beebe, 6 days ago
2 100 2 days ago
Support · by blu3prince, 3 days ago
0 51 3 days ago
Support · by alex, 4 days ago
2 92 3 days ago
Support · by Marcel, 2 weeks ago
1 143 4 days ago