質問 > フロント機能 > サイトマップページの作成 |
フロント機能
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
Yasuhiro |
投稿日時: 2010/1/12 18:07
対応状況: −−−
|
半人前 登録日: 2010/1/12 居住地: 新宿区 投稿: 22 |
Re: サイトマップページの作成 参考URLを拝見させて頂きましたが、情報が無いように思えます。
正しいURLを教えて貰えないでしょうか?
|
seasoft |
投稿日時: 2010/1/12 18:13
対応状況: −−−
|
神 登録日: 2008/6/4 居住地: 投稿: 7367 |
Re: サイトマップページの作成 引用:
zibaj 様の参照先ページ本文中の「Download」というリンク文字列から参照しているのでは? ソースは未確認ですが、 何の「初心者」なのか分かりませんが、PHP の初心者という事ですと、難しいかも。
|
tao_s |
投稿日時: 2010/1/12 21:22
対応状況: −−−
|
仙人 登録日: 2008/8/20 居住地: 東京 投稿: 799 |
Re: サイトマップページの作成 EC-CUBE初心者なのであれば、こことかが参考になると思います。
http://wiki.ec-cube.net/index.php?%B6%A6%C4%CC%2F4_%A5%C7%A5%B6%A5%A4%A5%F3%A5%AB%A5%B9%A5%BF%A5%DE%A5%A4%A5%BA http://wiki.ec-orange2.jp/index.php?%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA%EF%BC%9A%E5%9F%BA%E7%A4%8E%2F%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E6%A7%8B%E6%88%90%E3%82%92%E7%90%86%E8%A7%A3%E3%81%97%E3%82%88%E3%81%86
|
tao_s |
投稿日時: 2010/1/13 4:17
対応状況: −−−
|
仙人 登録日: 2008/8/20 居住地: 東京 投稿: 799 |
Re: サイトマップページの作成 と言う事で作ってみました。
商品詳細ページまで含めると大変な事になるので、商品ページはカテゴリまで(カテゴリブロックからソースを拝借して)作りました。 http://eccube-customize.xross-cube.com/sitemap/index.php
|
Yasuhiro |
投稿日時: 2010/1/13 12:31
対応状況: −−−
|
半人前 登録日: 2010/1/12 居住地: 新宿区 投稿: 22 |
Re: サイトマップページの作成 まさしく、これがやりたかったのです。
たいへん厚かましいのですが、手順とかソースを拝見させて頂けないでしょうか?
|
tao_s |
投稿日時: 2010/1/13 14:57
対応状況: −−−
|
仙人 登録日: 2008/8/20 居住地: 東京 投稿: 799 |
Re: サイトマップページの作成 引用:
たいへん厚かましいのですが、手順とかソースを拝見させて頂けないでしょうか? 手順に関しては先の書き込みのURLを参照願います。
|
Yasuhiro |
投稿日時: 2010/1/13 18:49
対応状況: −−−
|
半人前 登録日: 2010/1/12 居住地: 新宿区 投稿: 22 |
Re: サイトマップページの作成 以下の手順で、サイトマップページを作成しようとしていますが、商品カテゴリの表示のみ上手く行きません。
どこが悪いのでしょうか? 1.呼出用ファイル作成 /html/sitemap/index.php /data/class_extends/pages/sitemap/LC_Page_Sitemap_Ex.php /data/class/pages/sitemap/LC_Page_Sitemap.php 2.DBの変更 dtb_pagelayoutにサイトマップを追加 3.LC_Page_Sitemap.phpのソース <?php /* * This file is part of EC-CUBE * * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. * * http://www.lockon.co.jp/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // {{{ requires require_once(CLASS_PATH . "pages/LC_Page.php"); /** * サイトマップ のページクラス. * * @package Page * @author LOCKON CO.,LTD. * @version $Id: LC_Page_Entry_Kiyaku.php 16741 2007-11-08 00:43:24Z adachi $ */ class LC_Page_Sitemap extends LC_Page { // {{{ properties /** ページナンバー */ var $tpl_pageno; // }}} // {{{ functions /** * Page を初期化する. * * @return void */ function init() { parent::init(); $this->tpl_mainpage = 'sitemap/index.tpl'; $this->tpl_title = "サイトマップ"; } /** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, "sitemap/index.php"); $objView->assignobj($this); $objView->display(SITE_FRAME); } /** * モバイルページを初期化する. * * @return void */ function mobileInit() { $this->init(); } /** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; $next = $offset; // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, "sitemap/index.php"); $objView->assignobj($this); $objView->display(SITE_FRAME); } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } // カテゴリツリーの取得 function lfGetCatTree($arrParent_category_id, $count_check = false) { $objQuery = new SC_Query(); $objDb = new SC_Helper_DB_Ex(); $col = "*"; $from = "dtb_category left join dtb_category_total_count using (category_id)"; // 登録商品数のチェック if($count_check) { $where = "del_flg = 0 AND product_count > 0"; } else { $where = "del_flg = 0"; } $objQuery->setoption("ORDER BY rank DESC"); $arrRet = $objQuery->select($col, $from, $where); foreach ($arrParent_category_id as $category_id) { $arrParentID = $objDb->sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $category_id); $arrBrothersID = SC_Utils_Ex::sfGetBrothersArray($arrRet, 'parent_category_id', 'category_id', $arrParentID); $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $category_id); $this->root_parent_id[] = $arrParentID[0]; $arrDispID = array_merge($arrBrothersID, $arrChildrenID); foreach($arrRet as $key => $array) { foreach($arrDispID as $val) { if($array['category_id'] == $val) { $arrRet[$key]['display'] = 1; break; } } } } $this->arrTree = $arrRet; } // メインカテゴリーの取得 function lfGetMainCat($count_check = false, &$objSubPage) { $objQuery = new SC_Query(); $col = "*"; $from = "dtb_category left join dtb_category_total_count using (category_id)"; // メインカテゴリーとその直下のカテゴリーを取得する。 $where = 'level <= 2 AND del_flg = 0'; // 登録商品数のチェック if($count_check) { $where .= " AND product_count > 0"; } $objQuery->setoption("ORDER BY rank DESC"); $arrRet = $objQuery->select($col, $from, $where); // メインカテゴリーを抽出する。 $arrMainCat = array(); foreach ($arrRet as $cat) { if ($cat['level'] != 1) { continue; } // 子カテゴリーを持つかどうかを調べる。 $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $cat['category_id']); $cat['has_children'] = count($arrChildrenID) > 0; $arrMainCat[] = $cat; } $objSubPage->arrCat = $arrMainCat; return $objSubPage; } } ?> 4.サイトマップのページ詳細設定の内容 <div id="undercolumn"> <div id="listtitle"> <h2>サイトマップ</h2> </div> <div> <ul> <li><a href="<!--{$smarty.const.SITE_URL}-->">トップページ</a></li> <li><a href="<!--{$smarty.const.URL_DIR}-->products/list.php">全商品</a></li> <!--{assign var=preLev value=1}--> <!--{assign var=firstdone value=0}--> <!--{section name=cnt loop=$arrTree}--> <!--{assign var=level value=`$arrTree[cnt].level`}--> <!--{assign var=levdiff value=`$level-$preLev`}--> <!--{if $levdiff > 0}--> <ul> <!--{elseif $levdiff == 0 && $firstdone == 1}--> </li> <!--{elseif $levdiff < 0}--> <!--{section name=d loop=`$levdiff*-1`}--> </li> </ul> <!--{/section}--> </li> <!--{/if}--> <li class="level<!--{$level}--><!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> onmark<!--{/if}-->"><a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrTree[cnt].category_id}-->"<!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> class="onlink"<!--{/if}-->><!--{$arrTree[cnt].category_name|escape}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a> <!--{if $firstdone == 0}--><!--{assign var=firstdone value=1}--><!--{/if}--> <!--{assign var=preLev value=`$level`}--> <!--{* セクションの最後に閉じタグを追加 *}--> <!--{if $smarty.section.cnt.last}--> <!--{if $preLev-1 > 0 }--> <!--{section name=d loop=`$preLev-1`}--> </li> </ul> <!--{/section}--> </li> <!--{else}--> </li> <!--{/if}--> <!--{/if}--> <!--{/section}--> <li><a href="<!--{$smarty.const.URL_DIR}-->abouts/index.php">当サイトについて</a></li> <li><a href="<!--{$smarty.const.SSL_URL}-->contact/index.php">お問い合わせ</a></li> <li><a href="<!--{$smarty.const.URL_DIR}-->order/index.php">特定商取引に関する法律</a></li> <li><a href="<!--{$smarty.const.URL_DIR}-->sitemap/index.php">サイトマップ</a></li> </ul> </div> <div>
|
tao_s |
投稿日時: 2010/1/14 5:11
対応状況: −−−
|
仙人 登録日: 2008/8/20 居住地: 東京 投稿: 799 |
Re: サイトマップページの作成 EC-CUBEではinit()の後にprocess()が実行されます。
なので、メインのロジックはprocess()内に書かないとダメですよ。
|
Yasuhiro |
投稿日時: 2010/1/14 12:20
対応状況: −−−
|
半人前 登録日: 2010/1/12 居住地: 新宿区 投稿: 22 |
Re: サイトマップページの作成 引用:
つまり、全てphp内で処理させる方法ですね? その場合のLC_Page_Sitemap.phpのソースは、どのようになるのでしょうか? http://eccube-customize.xross-cube.com/sitemap/index.php 具体的にこちらのケースでは、どのように記述しているか、参考にさせて下さい。
|
flealog |
投稿日時: 2010/1/14 15:56
対応状況: −−−
|
仙人 登録日: 2008/6/10 居住地: 投稿: 485 |
Re: サイトマップページの作成 ぐはっ!?
編集ミスった・・・orz ソースを参考に少し書き足したら表示されましたよ〜 参考になるようでしたら使ってください^^
|
« 1 (2) 3 » |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |