Jump to content

Multiple images upload - Pages > fields (record)


Hisashi
 Share

Go to solution Solved by opentype,

Recommended Posts

Hello,

I'm trying to get multiple image upload field to work and I'm just getting frustrating results, could anyone help me?

When I put an image it works, more than one it breaks.

--------

Current settings:

Screenshot_150.png.a1270c74d660d392b97b41e96b360a26.png

Screenshot_152.thumb.png.2c7fe433a5c7823e5b5258f79d56cbf1.png

Screenshot_153.png.84e7045defd7309a0d3d3a309fee623b.png


I added in Pages > templates > record

{$record->customFieldDisplayByKey('upload_img', 'display')|raw}

 

Result:

Screenshot_155.png.4d7b6cea56d43bb668457c6ae6185b8b.png

So I changed code in record to

<img class="ipsImage" src="url/uploads/{$record->customFieldDisplayByKey('upload_img', 'display')|raw}">

Result:

Screenshot_157.png.d85d581451806364733afa7667da9820.png

When will I put more than one image

Screenshot_158.thumb.png.fd092eb14752c45df291b59330fe9260.png

Result:

Screenshot_156.png.93b1f21733896e29c73abc8989a2ea3f.png

 

Does anyone know how to fix this? To be able to display multiple images

Link to comment
Share on other sites

  • Solution

Something to start with:

{{if $formValue}}
<div class="ipsGrid ipsGrid_collapsePhone">
{{foreach $value as $file}}
  <div class="ipsGrid_span4 ipsSpacer_bottom">
<img src="{file='$file' extension='cms_Records'}" class="ipsImage">
  </div>
{{endforeach}}
</div>
{{endif}}

 

Link to comment
Share on other sites

10 minutes ago, opentype said:

Something to start with:

{{if $formValue}}
<div class="ipsGrid ipsGrid_collapsePhone">
{{foreach $value as $file}}
  <div class="ipsGrid_span4 ipsSpacer_bottom">
<img src="{file='$file' extension='cms_Records'}" class="ipsImage">
  </div>
{{endforeach}}
</div>
{{endif}}

 

Amazing, it worked well thank you!!

Screenshot_159.png.cf712a359d146ee882eaa8eb633f8af7.png

Since I'm going to use large images 1200x1800, I removed line

<div class="ipsGrid_span4 ipsSpacer_bottom"></div>

It worked well, is there a problem with that?

Screenshot_162.thumb.png.ca2c28717c9ffc256c2dbed93ba043b0.png

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...