Hide Images in Overflow Text within Gather

5 댓글

  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hi Samuel,
     
    Are you looking to provide no preview in cases where there are images?  Or are you looking to do a text-only preview in all cases?
    0
  • Samuel Brown

    Hi Christopher Kennedy,

    In the case that someone has used an image, I would be looking for only the text to be pulled through into the post list page rather than nothing at all.

    0
  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hi Samuel,
     
    Thanks for the context.  This would require some custom JS to locate the images within the post content and then hide them.  Here's a sample that does so within your example .postdetails container:
     
    const postImages = document.querySelectorAll(".postdetails img");

    postImages.forEach((image) => {
    image.style.display = 'none';
    });
    1
  • Samuel Brown

    That has fixed my issue! Thank you so much for your advice.

    0
  • Christopher Kennedy
    Zendesk Developer Advocacy
    No problem :)
    0

댓글을 남기려면 로그인하세요.

Zendesk 제공