Bootstrap one-page multi-Carousel combined with samrty and bootstrapsamrty

Source: Internet
Author: User
Tags smarty template

Bootstrap one-page multi-Carousel combined with samrty and bootstrapsamrty

When bootstrap has multiple carousel entries on one page, many people may encounter scenarios where only one carousel can be used, and other carousel entries fail. There are not many materials on the Internet. In fact, this problem may occur because the carousel ID is repeated, which leads to multiple carousel entries on one page of bootstrap.

When I was working on a project, I combined the smarty template to implement scalable configuration carousel and multiple carousel functions on one page.

View layer:

// Test data $ result = '{"service_type": "car", "view": {"picinfo": {"tag_name": "image information", "data ": {"pic_1": {"explain": "Vehicle 1", "type": "text", "options": "", "value ":[".. /.. /.. /web/images/id_card_po ",".. /.. /.. /web/images/borrower_contract ",".. /.. /.. /web/images/car_dashboard "]}," pic_2 ": {" explain ":" Vehicle 2 "," type ":" text "," options ":"", "value ":[".. /.. /.. /web/images/car_dashboard ",".. /.. /.. /web/images/reg_car_info "] }}}'; $ pictures = json_decode ($ result, true); // The array is changed to $ picdata = array (); $ layoutpic = ['picinfo' => [['pic _ 1', 'pic _ 2']; foreach ($ layoutpic as $ key => $ kuai) {$ datakuai = array (); $ temp = $ pictures ['view'] [$ key]; foreach ($ kuai as $ hang) {$ datahang = array (); foreach ($ hang as $ lie) {$ a = $ temp ['data']; $ datahang [$ a [$ lie] ['expln'] = $ a [$ lie] ['value']; // var_dump ($ datahang ); // var_dump ($ a [$ lie] ['value']);} array_push ($ datakuai, $ datahang );} $ picdata [$ temp ['tag _ name'] = $ datakuai;} foreach ($ picdata as $ key => $ value) {foreach ($ value as $ key1 =>$ value1) {}}$ smarty-> assign ("mypicture1", $ value1 );

Tpls template:

{Foreach $ mypicture1 as $ a => B B} <div style = "float: left; display: inline "class =" infoblock mgt "> 



Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.