phpcms手機門戶相關

來源:互聯網
上載者:User

標籤:

相關標籤

{$WAP[‘sitename‘]}標題

{list_url(3)} 調取欄目連結

{template "wap","header"}{template "wap","footer"}

 

調取詳細資料

{pc:wap action="lists" typeid="3" num="10" order="id ASC" return="info"}

{loop $info $i}

<dl>
<dt><a href="{show_url($i[catid],$i[id])}"><img src="{thumb($i[thumb])}"></a></dt>
<dd><a href="{show_url($i[catid],$i[id])}">{str_cut($i[‘title‘],26,‘‘)}</a><p>{str_cut($i[‘description‘],80,‘‘)}</p></dd>
</dl>
{/loop}
{/pc}

 

 

無法調取單頁面的解決方案!!

當前的Phpcms V9手機網站的設定還有點弱,綁定的欄目不能設定選擇模板,而且不能綁定單頁面page。不過可以自訂做到綁定單頁面page這一個功能:
1、修改phpcms\modules\wap\index.php,添加 function page()函數:
//CMSYOU DIY單頁
    function page() {
    $WAP = $this->wap;
    $TYPE = $this->types;
    $WAP_SETTING = string2array($WAP[‘setting‘]);
    $GLOBALS[‘siteid‘] = max($this->siteid,1);
    include template(‘wap‘, ‘page‘);
    }

可以加在function maps() 函數後。這一段function page()函數的大體意思是,添加一個page模型,可以通過index.php?m=wap&a=page訪問手機wap模板目錄下的page模板。
2、在手機wap模板目錄下新增page.html模板檔案。
3、在手機header.html模板中加入自訂連結,雖然在後台設定中看不到單頁的欄目,但是可以實際調用單頁資料了,可以靈活定義單頁模板page.html檔案,做到不同catid訪問不同內容。
舉例:
page.html模板中設定:
{php $catid = $_GET[‘catid‘];}
{pc:get sql="SELECT * FROM cmsyou_page WHERE catid=‘$catid‘" cache="0" return="data"}
{loop $data $val}
{$val[content]} - {$catid}
{/loop}
{/pc}

這樣可以通過index.php?m=wap&a=page&catid=2,訪問後台欄目id為2的單頁內容了!

 

  1. 確定一個網域名稱作為你手機wap網站的訪問網域名稱,例如:http://m.tezhengzong.com。接下來在網域名稱管理系統中簡析這個網域名稱到你的伺服器位址。

  2. 修改\caches\configs\route.php 檔案,增加手機路由地址,方法如下:

    return array(

            ‘default‘=>array(‘m‘=>‘content‘, ‘c‘=>‘index‘, ‘a‘=>‘init‘),

            ‘m.tezhengzong.com‘=>array(‘m‘=>‘wap‘, ‘c‘=>‘index‘, ‘a‘=>‘init‘),

    );

phpcms手機門戶相關

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.