Media & Text Block
-
I created a “Media & Text” Block and then duplicated it
I add a link to “Media File” on the first block but not the second block
You can see what went wrong when you click on the link
It is difficult to describe in wordsThe page I need help with: [log in to see the link]
-
Hi, did you get this issue sorted out? What do you see happening versus what are you expecting to happen?
When I click on the linked image in the first block, it opens up a popup window showing that image.
You must see something different to me which is a bit puzzling
I don’t know how to proceed
Can I send you a screen dump of what I see?
Let me try to explain
I see 2 versions of this text
The new colour of the emerging new fronds of Adiantum venustum was a lovely surprise today.
and to the right of this code is a pictures of a fern
The top picture is about twice as big as the bottom picture even though they are duplicates of each other
The top picture has a vertical white line through it and the larger section on the left has the link but the smaller section on the right does not
The bottom image does not have the link as I did not add it. This is the only difference between these 2 duplicated blocks
Can you descibe what you see?- This reply was modified 4 years, 7 months ago by Andrew Leonard.
- This reply was modified 4 years, 7 months ago by Andrew Leonard.
- This reply was modified 4 years, 7 months ago by Andrew Leonard. Reason: cosmetic changes
Hello again, yes I see that as well. I thought you meant that there was something wrong when clicking on the link of the image itself, not the display.
The white line isn’t really an issue as that is only showing up due to the image not being the width of the one below it. The one below it has the same white line applied in CSS but as it is the correct width you aren’t seeing it
#content .entry-content a img, #content .entry-content img { border: 5px solid white; }
Are you able to copy the block code you have for both from your page into here so I can see those? If you click on the 3 vertical dots at the top right of the right sidebar when editing a page/post, you should see an option to enable the Code Editor so you can copy the block contents.
<!-- wp:media-text {"mediaId":27517,"mediaLink":"https://ebps.org.uk/adiantum-and-its-colours/adiantum-venustum/","linkDestination":"media","mediaType":"image","mediaWidth":68,"imageFill":true} --> <div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill" style="grid-template-columns:68% auto"><figure class="wp-block-media-text__media" style="background-image:url(https://ebps.org.uk/wp-content/uploads/2020/04/Adiantum-venustum-338x600.jpg);background-position:50% 50%"><a href="https://ebps.org.uk/wp-content/uploads/2020/04/Adiantum-venustum.jpg"><img src="https://ebps.org.uk/wp-content/uploads/2020/04/Adiantum-venustum-338x600.jpg" alt="" class="wp-image-27517"/></a></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…","fontSize":"small"} --> <p class="has-small-font-size">The new colour of the emerging new fronds of Adiantum venustum was a lovely surprise today.</p> <!-- /wp:paragraph --></div></div> <!-- /wp:media-text --> <!-- wp:media-text {"mediaId":27517,"mediaLink":"https://ebps.org.uk/adiantum-and-its-colours/adiantum-venustum/","linkDestination":"none","mediaType":"image","mediaWidth":68,"imageFill":true} --> <div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill" style="grid-template-columns:68% auto"><figure class="wp-block-media-text__media" style="background-image:url(https://ebps.org.uk/wp-content/uploads/2020/04/Adiantum-venustum-338x600.jpg);background-position:50% 50%"><img src="https://ebps.org.uk/wp-content/uploads/2020/04/Adiantum-venustum-338x600.jpg" alt="" class="wp-image-27517"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…","fontSize":"small"} --> <p class="has-small-font-size">The new colour of the emerging new fronds of Adiantum venustum was a lovely surprise today.</p> <!-- /wp:paragraph --></div></div> <!-- /wp:media-text -->
I compared these two blocks of code and these are the differences:
"none"
changed to"media"
link added
<a href="https://ebps.org.uk/wp-content/uploads/2020/04/Adiantum-venustum.jpg"></a>
Perhaps you have not read carefully my notes
Both blocks are identical because i duplicated them
The only difference is I added a link to the first one and not the second
They should (must?) look identical
The white line is a big problem for me, as is the erroneous part of the image to the right of the white line which has no link attached to it, as is the image showuing up as the wrong size…
The images are identical in each block, one is not “wider” than the other
I am a bit frustrated because it is so obvious to me but I am having greater difficulty in getting you to comprehend what seems like an obvious bug
I am sure you could reproduce this on your system and immediately understand the problem?Hi, I understand the issue here, I just wanted to see your exact code so I could replicate on my end. This isn’t related to TwentyFourteen specifically though as it happens on TwentyTwenty as well.
Going to try to research further to figure out the issue.
Alright, this is a pretty specific case here that you came across. It has to do with the media in the media/text block having a link, being a narrow image and having the “Crop image to fill entire column” option configured in the block settings.
If you decrease the “width” of the media column in the block to less than the width of the image or remove it as a link the duplicated image will go away.
I’ve reported the issue with WordPress here:
Thanks for trying to get on top of the issue
However I don’t think you have quite understood it fully
Have a look at the page now: https://ebps.org.uk/adiantum-and-its-colours/
I have now created 4 “duplicates/versions” of the “Adiantum block with all combinations of the possibilities of “link” and “Crop”I have also added 2 new blocks, both a duplicate of each other and then added a link to the top one
Now the “white line” is horizontal (and incidently there is some “displacement/alignment” issues with the images)
So it is not just a case of width, it will go wrong with any size of imageAlso when trying to copy the “text” part of the block, it copies it from one block to 3 blocks and then it is not easy to reconvert 3 text blocks back into one and get rid of the unmwanted blocks. The block editor is clearly buggy
The CSS code I mentioned previously here that you have setup in your child theme is the cause for that white line showing up on the 2nd to last block.
If you comment that CSS out of your style.css file, save the changes and then refresh the page you can see that the 2nd to last block will be fixed and not show the additional image along the bottom.
The initial issue that was reported in the Trac ticket is still valid but the white line issue you are seeing is due to custom CSS you’ve applied in your child theme as the CSS does not exist within the default TwentyFourteen theme
Thank you
I had misunderstood you
I did not appreciate that my CSS was causing some of the problem
I have removed it but it was useful for galleries
I copied the code from an article and I created a comment which says “Remove grey borders from WordPress Gallery (11/04/2018)”
Is there a better way of doing this?
- The topic ‘Media & Text Block’ is closed to new replies.