News images not displaying

  • Hi there.


    I hope someone can help. Our client has got a news page which features one image and then text that's visible on a slider. They wanted to add more images to the body copy but if I add it using the insert image button in the editor it doesn't display an image in the backend or front end (backend does put in the [cms: asset XXXX] but nothing visual).


    And if I do it using a link to the image it does show the image in the backend but nothing on the front end.


    The site is keningtons.com if that helps!


    I'm not a developer so hopefully there's something that can be done in the Perch CMS itself rather than on the server!


    Cheers!

  • drewm

    Approved the thread.
  • Hi there.


    When you say it's the expected behaviour, I'm not sure what you mean – the image is not visible on the front end of the site, the only reference I can see is the shortcode in the backend that's doing nothing.


    Not sure what text editor I'm using, where do I find that out?


    Best,

    Nick.

  • When you say it's the expected behaviour, I'm not sure what you mean

    It is expected to see a shortcode instead of an inline image while editing the field.



    the image is not visible on the front end of the site, the only reference I can see is the shortcode in the backend that's doing nothing.

    Perch always replaces the shortcode. If it can render what the shortcode defines, it will replace it with that. Otherwise, it will replace it with nothing.

  • Hi there.


    Thanks for the reply.


    That's why I was questioning it being expected behaviour – the shortcode is in the backend but the front end is blank, which isn't what I'd call expected behaviour, but I was then wondering if the expected behaviour was for it to NOT output an image (for some reason!). Glad I'm at least looking at the correct solution.


    The image I'm using is in the Assets folder and the shortcode being generated uses its asset number, so it should be able to find it. Any reason it wouldn't render it?


    And is there an alternative solution?


    Would the site URL make it easier to diagnose?


    Best,

    Nick.

  • Oh, sorry, I didn't see the https://keningtons.com/ text/link in the first post but where is the specific post with the image problem?


    Can you also share your template for the area with the problem. I appreciate it's just a textarea field where you see the problem but I'd like to look at the complete templates. Thanks.

  • Hi Clive.


    Thanks for your response.


    The issue is on the news section (keningtons.com/news) – the template allows for a featured image to be added on the side, but they'd like to add more in the expanded text area.


    To answer your previous question, when using the shortcode nothing is there, when using an image link. If adding a link and pasting the asset URL in it displays the URL as a clickable link instead of the image (this is in there so you can see).


    Attached is an image of the backend – is that enough to see the template or do you need anything else?

  • Hi Clive.


    Thanks for the reply.


    I haven't got access to the server so unfortunately won't be able to get the template code.


    To answer your question, though, this is how the images are looking in our news posts:

    <figure><img src="https://keningtons.com/perch/resources/News/before.jpg" data-image="6325nibzl1hh"></figure>

    <figure><img src="https://keningtons.com/perch/resources/News/after.jpg" data-image="s1i0vlhnkjyg"></figure>


    The system seems to be adding the <figure> bits and if I remove them it adds it back in so I'm assuming that's fine.


    I've tried the suggested img syntax from the Perch help page (

    <img src="<perch:content id="logo" type="image" label="Logo">" alt="<perch:content id="logoalt" type="text" label="Alt text">"> )


    but it just brings up a broken image icon and then a rogue "> outputting on the page.


    In the above Perch syntax is replaced perch:content with cms:(image code). Is that right? If not, where do I find the info for the perch:content bit?


    Cheers for all your help!


    Best,

    Nick.

  • Quote

    I haven't got access to the server so unfortunately won't be able to get the template code.

    You don't have FTP access?

    Quote

    this is how the images are looking in our news posts:
    <figure><img src="https://keningtons.com/perch/resources/News/before.jpg" data-image="6325nibzl1hh"></figure>

    That's not how the images are being output on the front end. I'm surprised.

    Quote

    I've tried the suggested img syntax from the Perch help page

    You cannot mix template code in the editor box. It doesn't work like that.


    In light of the above problems, I suggest you install the plugin I suggested in my other post. However, if you do not have FTP access or a test server environment to test it first, you won't be able to do this ....


    ... so I'm not sure how I can help further.


    Without the appropriate access to the server, I think you are stuck and you should report that to the client.

  • Hi Clive.


    Sorry, what I mean I don't have access to the FTP at this location as we don't host our Perch sites in the way we do with WordPress. I'll need to raise it with our developer if that's the required solution – I was hoping to avoid it but if I can't then that's what I'll have to do.


    To clarify the above re template code – I did think that would be the case, just wanted to try it in case it worked!


    Thanks for your help on this.


    Best,
    Nick.