Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture cover post #18

Closed
MiFrance opened this issue Mar 17, 2019 · 18 comments
Closed

Picture cover post #18

MiFrance opened this issue Mar 17, 2019 · 18 comments
Labels
bug Something isn't working

Comments

@MiFrance
Copy link
Contributor

Have a issue with cover image post.
If I select an image, it is not displayed on the blog or on the article concerned.

@giuscris giuscris added the bug Something isn't working label Mar 17, 2019
@giuscris
Copy link
Member

It's a templates issue. Fix it soon, thanks for discovering it 👍

@giuscris
Copy link
Member

Fixed!

@MiFrance
Copy link
Contributor Author

Cover don't work for me on MAMP with 2 template change...
I added cover image on 2 blog post and don't show.

@giuscris
Copy link
Member

Could you post the content of the affected pages?

@giuscris giuscris reopened this Mar 17, 2019
@MiFrance
Copy link
Contributor Author

---
title: Hello World!
publish-date: 2018-06-15
image: danger_filtrage.jpg
---
This is an example of blog post.

@giuscris
Copy link
Member

Where is the image located? The filename is relative to the page.

@MiFrance
Copy link
Contributor Author

Capture d’écran 2019-03-18 à 00 20 02

@MiFrance
Copy link
Contributor Author

And code of templates/partials/cover-image.php

<?php if ($page->has('image')): ?>
    <div class="cover-image" style="background-image:url(<?= $page->get('image') ?>);"></div>
<?php endif; ?>

@giuscris
Copy link
Member

Can you see the image at http://path/to/page/danger_filtrage.jpg?

@MiFrance
Copy link
Contributor Author

If i add a picture in post OR page is't OK
Is just the cover image don't show

@MiFrance
Copy link
Contributor Author

Example to work:

---
title: Hello World!
publish-date: 2018-06-15
image: danger_filtrage.jpg
---
This is an example of blog post.

![](danger_filtrage.jpg)

@giuscris
Copy link
Member

If i add a picture in post OR page is't OK
Is just the cover image don't show

It seems the image is correctly served so the problem shouldn't be in the backend. Have you tried with another image?

@MiFrance
Copy link
Contributor Author

Yes same issue with another image in other posts...
Is just for the cover image.

@giuscris
Copy link
Member

image

You should get something like this.

@giuscris
Copy link
Member

Which browser do you use? I've just discovered that Firefox doesn't render the cover image because of the template styles. I'll fix it soon.

@MiFrance
Copy link
Contributor Author

Exactly ! I use Firefox 65.0.1 for Mac.
I just tryed on Safari and is work great ;)

@MiFrance
Copy link
Contributor Author

Fix:

In templates/partials/cover-image.php, remplace PHP by:

<?php if ($page->has('image')): ?>
    <img class="cover-image" src="<?= $page->get('image') ?>" alt="cover image"/>
<?php endif; ?>

@giuscris
Copy link
Member

You're actually using an <img> tag but there are issues with different image sizes, so using the background-image is the best approach. Just let me fix issue #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants