Phpcms V9 Submit a multi-plot field in the foreground custom form

Source: Internet
Author: User

Phpcms V9 in the custom field supports image upload and multi-image upload, but after the film is not visible, because TA directly output the array, not compiled!

To display its uploaded images directly in the form, you just need to modify the form's template, and here are the modified files and related code:

First find the page template for the form, ". /phpcms/modules/formguide/templates/formguide_info_view.tpl.php", open and edit!

<?php if (Is_array ($forminfos _data)) {foreach ($forminfos _data as $key = + $form) {?> <tr> <td>< php echo $fields [$key] [' name ']?>:</td> <td>< php echo $form? ></TD&G                T </tr> <?php}}?>

Replace it with the following:

<?php foreach ($forminfos _data as  $key  =>  $val): ?> <tr>      <?php if (Is_array ($val)  &&  $key  ===  ' IMGs '):  ?>     <td><?php echo  $fields [$key] [' name '] ?>: </td>     <td><?php foreach ($val  as  $v): ?>          <a href= "<?php echo  $v [' url ']  ?> " target=" _blank " ></td>     <?php else: ?>      <td><?php echo  $fields [$key] [' Name '] ?>:</td>      <td><?php echo  $val  ?></td>      <?php endif&nBSP;? > </tr> <?php endforeach ?>

Effect:

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/96/A8/wKiom1kkEHDgKwgjAABGxI9b-y8820.jpg-wh_500x0-wm_ 3-wmp_4-s_1118369302.jpg "title=" qq20170523183419.jpg "alt=" Wkiom1kkehdgkwgjaabgxi9b-y8820.jpg-wh_50 "/>

This article is from the "jack_phpcms" blog, make sure to keep this source http://maifang158.blog.51cto.com/5433990/1928753

Phpcms V9 Submit a multi-plot field in the foreground custom form

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.