• 保存到桌面加入收藏设为首页
技术教程

EYOUCMS标签调用大全-功能篇

时间:2020-05-08 10:59:30   作者:dehua.site   来源:网络线报   阅读:71   评论:0
内容摘要:单个栏目/内容链接调用1.输出单个栏目链接:{eyou:type typeid='栏目ID' empty='暂时没有数据'}{$field.typename}{/eyou:t......

 留言 

留言表单

{eyou:guestbookform type='default'}
<form method="POST" class="am-form am-form-horizontal form-add" enctype="multipart/form-data" action="{$field.action}" onsubmit="return checkForm();">
<table class="hovertable">
<tr>
<td>{$field.itemname_1}:</td>
<td><input type="text" name="{$field.attr_1}" id="attr_1" size="50" value="" ></td>
</tr>
<tr>
<td>{$field.itemname_2}:</td>
<td><input type="text" name="{$field.attr_2}" id="attr_2" size="50" maxlength="20" value=""></td>
</tr>
<tr>
<td>{$field.itemname_3}:</td>
<td>
    <select name="{$field.attr_3}" id="attr_3">
    <option value="">{$field.itemname_3}</option>
    {eyou:volist name='$field.options_3' id='vo'}
    <option value="{$vo.value}">{$vo.value}</option>
    {/eyou:volist}
</td>
</tr>
<tr>
<td><button type="submit" class="bnt bookadd button">提交</button> {$field.hidden}</td>
<td><input type="reset" value="重设" class="bnt button" /></td>
</tr>
</table>
<form>
{/eyou:guestbookform}

js代码


 <script type="text/javascript">
	function checkForm()
	{
	  if(document.getElementById('attr_1').value.length == 0)
	  {
		alert('{$field.itemname_1}不能为空!');
		return false;
	  }
	  if(document.getElementById('attr_2').value.length == 0)
	  {
		alert('{$field.itemname_2}不能为空!');
		return false;
	  }
	  return true;
	}
  </script>

css代码


/*!表格表单专用css*/
table.hovertable{width:100%;font-family:verdana,arial,sans-serif;border-width:1px;border-color:#ddd;border-collapse:collapse;text-align:left;margin:13px auto}
table.hovertable th{background-color:#ddd;color:#333;border-width:1px;padding:8px;border-style:solid;border-color:#ddd}
table.hovertable tr{background-color:#fff}
table.hovertable td{border-width:1px;padding:8px;border-style:solid;border-color:#ddd}
table.hovertable input[type="text"],table.hovertable input[type="email"],table.hovertable textarea,table.hovertable select{border:1px solid#DADADA;color:#888;height:30px;line-height:30px;outline:0 none;width:70%;font-size:12px;box-shadow:inset 0px 1px 4px#ECECEC;-moz-box-shadow:inset 0px 1px 4px#ECECEC;-webkit-box-shadow:inset 0px 1px 4px#ECECEC}
table.hovertable textarea{padding:5px 3px 3px 5px}
table.hovertable select,table.hovertable input{width:70%;}
table.hovertable textarea{width:97%;height:100px;}
table.hovertable .button{background:#E27575;border:none;height:30px;line-height:30px;width:100px;color:#FFF;cursor:pointer}
table.hovertable .button:hover{background:#CF7A7A}
/*!表格专用css*/
table{max-width:100%;border-collapse:collapse;border-spacing:0}table,.table{width:100%;margin-bottom:18px}table th,.table th,table td,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #ddd !important}table th,.table th{font-weight:bold}table thead th,.table thead th{vertical-align:bottom}table thead:first-child tr th,.table thead:first-child tr th,table thead:first-child tr td,.table thead:first-child tr td{border-top:0}table tbody+tbody,.table tbody+tbody{border-top:2px solid #ddd !important}.table-condensed th,.table-condensed td{padding:4px 5px}table{border:1px solid #ddd !important;*border-collapse:collapsed;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}table th+th,table td+td,table th+td,table td+th{border-left:1px solid #ddd !important}table thead:last-child tr:last-child th:last-child,table tbody:last-child tr:last-child td:last-child{}.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5}table th{background:#fffbe9}.table th,.table td{vertical-align:middle}
volist循环输出记录



volist.可用于数据/记录等循环输出:

{eyou:channel type='top'}
	{eyou:volist name='$field.children' id='field1'}
		<a href='{$field1.typeurl}'>{$field1.typename}</a>
	{/eyou:volist}
{/eyou:channel}
如:留言表单里的下拉列表框
<select name="{$field.attr_7}" id="attr_7">
	<option value="无">无</option>
	{eyou:volist name='$field.options' id='field1'}
	 <!-- 下拉列表循环 start -->
	<option value="{$field1.value}">{$field1.value}</option>
	{/eyou:volist}
</select>

foreach.可用于数据/记录等循环输出(类似与volist标签,更简单,没有太多属性):

语法:
{eyou:channel type='top'}
	{eyou:foreach name='$field.children' item='field1'}
	<a href='{$field1.typeurl}'>{$field1.typename}</a>
	{/eyou:foreach}
{/eyou:channel}
如:留言表单里的下拉列表框
{eyou:foreach name='$field.options' item='field1'} 
<option value="{$field1.value}">{$field1.value}</option>
{/eyou:foreach} 

招聘 




列表页






tips.招聘列表页(lists_recruit.htm)输出职位列表:

  <table class="am-table am-table-striped am-table-hover">
    <thead>
      <tr>
        <th>职位名称</th>
        <th width="150">工作地点</th>
        <th width="150">招聘人数</th>
        <th width="180">薪资待遇</th>
        <th width="150">发布日期</th>
      </tr>
    </thead>
    <tbody>
     {eyou:list titlelen='30' pagesize='10' addfields='gzdd,zprs,xzdy'}
      <tr>
        <td><a href="{$field.arcurl}" title="{$field.title}">{$field.title}</a></td>
        <td>{$field.gzdd}</td>
        <td>{$field.zprs}</td>
        <td>{$field.xzdy}</td>
        <td>{$field.add_time|MyDate='Y-m-d',###}</td>
      </tr>
    {/eyou:list}  
    </tbody>
  </table>
  <div class="clear"></div>
  <div class="pagelist">
    <ul>
       {eyou:pagelist listitem='index,pre,pageno,next,end' listsize='2' /}
    </ul>
  </div>

内容页


1.招聘内容页(view_recruit.htm)参数调用标签:

工作地点:{$eyou.field.gzdd}
工作性质:{$eyou.field.gzxz}
学历要求:{$eyou.field.xlyq}
工作年限:{$eyou.field.gznx}
薪资待遇:{$eyou.field.xzdy}
招聘人数:{$eyou.field.zprs}
发布日期:{$eyou.field.add_time|MyDate='Y-m-d',###}
点击数:{eyou:arcclick /}
内容详情:{$eyou.field.nnxq}

2.招聘内容页(view_recruit.htm)在线应聘按钮:

{eyou:type typeid="6"}
    <div class="action"><a onclick="showdiv();" >{$field.typename}</a></div>
{/eyou:type}

3.在线应聘按钮:

{eyou:type typeid="6"}
    <div class="action"><a onclick="showdiv();" >{$field.typename}</a></div>
{/eyou:type}
应聘表单



<div class="job-popup">
  <div class="tit">在线应聘</div>
  {eyou:guestbookform typeid='6' type='default'}
  <form method="POST" class="am-form am-form-horizontal form-add" enctype="multipart/form-data" action="{$field.action}" onsubmit="return checkForm();">
    <dl>
      <dt>{$field.itemname_4}</dt>
      <dd>
        <input type="text" value="{$eyou.field.title}" name="{$field.attr_4}" id="attr_4"></dd>
    </dl>
    <dl>
      <dt>{$field.itemname_5}</dt>
      <dd>
        <input type="text" value="" name="{$field.attr_5}" id="attr_5"></dd>
    </dl>
    <dl>
      <dt>{$field.itemname_6}</dt>
      <dd>
        <select name="{$field.attr_6}" id="attr_6">
          <option value="">请选择性别</option>{eyou:volist name='$field.options_6' id='vo'}
          <option value="{$vo.value}">{$vo.value}</option>{/eyou:volist}</select></dd>
    </dl>
    <dl>
      <dt>{$field.itemname_7}</dt>
      <dd>
        <input type="text" value="" name="{$field.attr_7}" id="attr_7"></dd>
    </dl>
    <dl>
      <dt>{$field.itemname_16}</dt>
      <dd>
        <input type="text" value="" name="{$field.attr_16}" id="attr_16"></dd>
    </dl>
    <dl>
      <dt>{$field.itemname_18}</dt>
      <dd>
        <select name="{$field.attr_18}" id="attr_18">
          <option value="">请选择学历</option>{eyou:volist name='$field.options_18' id='vo'}
          <option value="{$vo.value}">{$vo.value}</option>{/eyou:volist}</select></dd>
    </dl>
    <dl>
      <dt>{$field.itemname_20}</dt>
      <dd>
        <textarea name="{$field.attr_20}" id="attr_20" rows="3" cols="50"></textarea>
      </dd>
    </dl>
    <dl>
      <dt>{$field.itemname_22}</dt>
      <dd>
        <textarea name="{$field.attr_22}" id="attr_22" rows="3" cols="50"></textarea>
      </dd>
    </dl>
    <dl>
      <dt></dt>
      <dd>
        <button type="submit" class="bt">提交</button></dd>
    </dl>{$field.hidden}
  </form>
  {/eyou:guestbookform}
</div>
js代码
<script type="text/javascript">
	function checkForm()
	{
	  if(document.getElementById('attr_5').value.length == 0)
	  {
		alert('{$field.itemname_5}不能为空!');
		return false;
	  }
	  if(document.getElementById('attr_16').value.length == 0)
	  {
		alert('{$field.itemname_16}不能为空!');
		return false;
	  }
	  return true;
	}
</script>
css代码



/*!招聘表单专用css*/
.job-popup{width: 580px;padding: 20px;font: 14px "microsoft yahei", arial, sans-serif;color: #555;overflow: hidden;position: relative;}
.job-popup dl{float: left; margin: 4px 0; position: relative; width: 100%; min-height:40px ; overflow: hidden;}
.job-popup dl dt,.job-popup dl dd{float: left;}
.job-popup dl dt{width: 80px;margin-top: 8px;text-align: right;line-height: 36px;}
.job-popup dl dd{width: 400px;margin-left: 10px;line-height: 36px;}
.job-popup dl dd input{padding: 0 4px;height: 36px;width: 400px;display: inline-block;border: 1px solid #d9d9d9;border-radius: 4px;-webkit-transition: all .3s;transition: all .3s}
.job-popup dl dd select{padding: 0 4px;border: 1px solid #d9d9d9;height: 36px;width: 400px;border-radius: 4px;}
.job-popup dl dd textarea{padding: 4px;border: 1px solid #d9d9d9;line-height: 20px;width: 400px;height: 100px;border-radius: 4px;}
::-webkit-input-placeholder{color:#bbb}
.job-popup dl dd input:focus{border: 1px solid #97cdf5;outline: 0;-webkit-box-shadow: 0 0 2px rgba(191,189,189,1);box-shadow: 0 0 2px rgba(191,189,189,1)}
.job-popup dl dd .bt{border: 0;padding: 8px 20px;background-color:#0e90d2;border-radius: 4px;color: #fff;}
.job-popup dl dd .bt:focus{border: 1px solid #97cdf5;outline: 0;-webkit-box-shadow: 0 0 2px rgba(191,189,189,1);box-shadow: 0 0 2px rgba(191,189,189,1)}
.job-popup .tit{line-height: 40px;text-align: center;font-size:16px;font-weight: bold;height: 40px}
volist循环输出记录



volist.可用于数据/记录等循环输出:

{eyou:channel type='top'}
	{eyou:volist name='$field.children' id='field1'}
		<a href='{$field1.typeurl}'>{$field1.typename}</a>
	{/eyou:volist}
{/eyou:channel}
如:表单里的下拉列表框
<select name="{$field.attr_7}" id="attr_7">
	<option value="无">无</option>
	{eyou:volist name='$field.options' id='field1'}
	 <!-- 下拉列表循环 start -->
	<option value="{$field1.value}">{$field1.value}</option>
	{/eyou:volist}
</select>

foreach.可用于数据/记录等循环输出(类似与volist标签,更简单,没有太多属性):

语法:
{eyou:channel type='top'}
	{eyou:foreach name='$field.children' item='field1'}
	<a href='{$field1.typeurl}'>{$field1.typename}</a>
	{/eyou:foreach}
{/eyou:channel}
如:留言表单里的下拉列表框
{eyou:foreach name='$field.options' item='field1'} 
<option value="{$field1.value}">{$field1.value}</option>
{/eyou:foreach} 

相关评论
广告联系:929967548     闽ICP备14005163号-3
Powered by OTCMS V5.20