Custom Fields
Support MB Views shortcode for img not working

  • Creator
  • #28013
    Resolved jimimac

    I've added a settings page with a single image field and then created a view where i've added the field however the image isnt displaying on the front end.

    Im using oxygen but this method has worked on another site so I'm not sure where I'm gong wrong.

    This is the code I'm using in view and I've checked that the group attribute details are correct.

    {% set group = attribute( site, 'page-details' ) %}
    <img src="{{ group.small_site_logo.full.url }}" width="100%" height="100%" alt="{{ group.small_site_logo.full.alt }}">
Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #28031
    Long Nguyen

    Hi Jimimac,

    As I understand, you've created a settings page with the field single_image. Then you create a view with the type shortcode to show the image on the settings page and add the shortcode to the Oxygen Builder.

    The code to show the image in View should be

    <img src="{{ site.option_name.field_id.thumbnail.url }}" width="{{ site.option_name.field_id.thumbnail.width }}" height="{{ site.option_name.field_id.thumbnail.height }}" alt="{{ site.option_name.field_id.thumbnail.alt }}">

    See my screenshot


    thx fo the tip !
    Perfect for me.
    Now I'd like ton know if it's possible to display a default image with MB View when if no featured image is set.

    For example add if... with this basic instruction :

    <img src="{{ post.thumbnail.thumbnail.url }}" width="{{ post.thumbnail.thumbnail.width }}" height="{{ post.thumbnail.thumbnail.height }}" alt="{{ post.thumbnail.thumbnail.alt }}" />

    Thx for you help !

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.