X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to add a new page to the admin? (https://forum.x-cart.com/showthread.php?t=31379)

sithlord 05-23-2007 01:42 PM

How to add a new page to the admin?
 
I've been searching, but I haven't found any posts on how to add a new page to the admin. I was trying to copy the other admin pages and taking out the code I didn't want. I was able to add a page and have the menus show up, but I get an error in the content area "Page not found! The requested page does not exist or you are not allowed to access it! ". Any help is always appreciated.

Thanks

sithlord 05-23-2007 02:22 PM

Re: How to add a new page to the admin?
 
I should have posted here sooner, since I figured it out within 15 minutes of asking how to do it :)

If anyone else wants to know here's how:

Create your php file in the admin folder -> xcart_dir/admin/file_name.php

PHP Code:

require "./auth.php";
require 
$xcart_dir."/include/security.php";

$location[] = array("New File Menu""");//bread crumb menu

$smarty->assign("main""file_name");//skin/single/home.tpl 


# Assign the current location line
$smarty->assign("location"$location);

@include 
$xcart_dir."/modules/gold_display.php";
func_display("admin/home.tpl",$smarty); 


Then make the template file under skin/admin/main/file_name.tpl

Code:

{include file="page_title.tpl" title="Page Title"}
//additional smarty code...


Finally edit skin/single/home.tpl and add an elseif statement like so
Code:

{elseif $main eq "file_name"}
{include file="admin/main/file_name.tpl"}


Of course add the link in the admin menus which I haven't done yet


All times are GMT -8. The time now is 02:26 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.