Making Generic Module titles

Source: Internet
Author: User

Simple module title generally have text and pictures two ways, text in addition to the title can also add more links, the use of common.less can be used to share the style, each development of a template, as long as the title can be done once, very convenient.

 <Grouptitle= "Module title">            < Sectiontitle= "caption Settings"folded= "false">                <paramDescription=""FormType= "Range"label= "caption Display mode:"name= "Title_module"PType= "text">                   <optionvalue= "1"selected= "Selected">Text mode</option>                  <optionvalue= "2">Custom Picture mode</option>                                 <optionvalue= "0">X does not display</option>                 </param>            </ Section>            < Sectiontitle= "text mode"folded= "false">                <paramDescription=""FormType= "text"label= "Title text:"name= "title"PType= "text">Category recommendation</param>                <paramDescription=""FormType= "text"label= "More text:"name= "Title_more"PType= "text">More+</param>                <paramDescription=""FormType= "text"label= "More Links:"name= "More_link"PType= "text">#</param>            </ Section>            < Sectiontitle= "Custom picture mode"folded= "false">                <paramDescription= "width 950, height unlimited"FormType= "text"label= "Picture address:"name= "Title_img"PType= "text"></param>            </ Section>        </Group>

Common.less

. Title1{Height:30px;Line-height:30px;Padding-left:14px;font-size:14px;Overflow:Hidden;position:relative;background:#e4e3e8;Margin-bottom:10px;. More{position:Absolute; Right:10px;Display:Block;Line-height:30px;Top:0;Color:#000;text-decoration:None;}}

CSS in the corresponding module

. Moduletitle {. title1;}

PHP Code:

//Module Title$title _module=$_module[' Title_module '];//Title Mode$title=$_module[' title '];//Title Text$title _more=$_module[' Title_more '];//more Text$more _link=$_module[' More_link '];//More Links$title _img=$_module[' title_img '];//Custom Pictureif($title _module==1){        //text Mode        Echo' <div class= ' moduletitle ' > '.$title.‘ <a class= "More" href= "'.$more _link.‘" > '.$title _more.‘ </a></div> '; }ElseIf($title _module==2){        //Custom Picture Mode        $title _pic=$title _img?$title _img: ‘.. /.. /assets/images/titlepic.jpg '; Echo' <div class= ' title_pic ' >$title _pic. ' "/></div> '; }Else{        //does not display        Echo‘‘; }

Making Generic Module titles

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.