[php]
CREATE TABLE dtb_nav (
nav_id int NOT NULL,
disp smallint NOT NULL DEFAULT 1,
nav smallint NOT NULL DEFAULT 1,
item text,
url text,
rank int NOT NULL DEFAULT 0,
creator_id int NOT NULL,
create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_date timestamp NOT NULL,
del_flg smallint NOT NULL DEFAULT 0,
PRIMARY KEY (nav_id)
);
[/php]
グローバルナビゲーションとフッターのナビ項目を管理画面から登録出来るようにします。
▼グローバルナビゲーション
![006](https://itoben.com/style/wp-content/uploads/2013/08/006-500x130.png)
▼フッター
![009](https://itoben.com/style/wp-content/uploads/2013/08/0091-500x47.png)
▼管理画面
![010](https://itoben.com/style/wp-content/uploads/2013/08/010-500x296.png)
・「非公開」にしておくと、ナビメニューには表示されません。
・並び順は、「上へ」「下へ」で変更します。
・URLは、http://から始まる絶対パスで入力します。
(1)データベースに追加
[php]
CREATE TABLE mtb_nav (
id smallint,
name text,
rank smallint NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);
[/php]
[php]
INSERT INTO mtb_nav (id, name, rank) VALUES (1, ‘ヘッダー’, 0);
INSERT INTO mtb_nav (id, name, rank) VALUES (2, ‘フッター’, 1);
[/php]
[php]
CREATE TABLE dtb_nav (
nav_id int NOT NULL,
disp smallint NOT NULL DEFAULT 1,
nav smallint NOT NULL DEFAULT 1,
item text,
url text,
rank int NOT NULL DEFAULT 0,
creator_id int NOT NULL,
create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_date timestamp NOT NULL,
del_flg smallint NOT NULL DEFAULT 0,
PRIMARY KEY (nav_id)
);
[/php]
(2)管理画面の作成
①■html/admin/contents/nav.php
②■data/class_extends/page_extends/admin/contents/LC_Page_Admin_Contents_Nav_Ex.php
③■data/class/pages/admin/contents/LC_Page_Admin_Contents_Nav.php
④■data/Smarty/templates/admin/contents/nav.tpl
⑤■data/Smarty/templates/admin/contents/subnavi.tpl(記述追加)
(3)フロントページに表示
①■html/frontparts/bloc/nav.php
②■data/class_extends/page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Nav_Ex.php
③■data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Nav.php
④■data/Smarty/templates/default/frontparts/bloc/nav.tpl