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