View Single Post
  #10  
Old 09-27-2009, 11:59 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: new/custom php page?

Quote:
Originally Posted by masada3336
Yep - I am trying to put together a new search module for my site. I've tried to dissect the search.php page. I've commented out just about everything to just a bare-bones page, but when I do that I get a "page not found" error.
I guess what I'm looking for is how to build a basic php page...what elements have to go in it, and where they have to be. I've gleaned from these forums that I need a php page with an include to a tpl file?

my search.php is this:

Code:
<?php # # $Id: mysearch.php,v 1.5.2.2 2008/04/11 18:09:11 osipov Exp $ # require "./auth.php"; require $xcart_dir."/include/categories.php"; require $xcart_dir."/skin1/mysearch.tpl"; $smarty->assign("_mysearch_",$_new_page_); $smarty->assign("main","_mysearch_"); $smarty->assign("location", $location); $smarty->assign("products",$products); func_display("customer/home.tpl",$smarty); ?>

I flushed my templates, but just for a test my tpl file:
Code:
{* $Id: mysearch.tpl *} test
The result is a page with the error "page not found" in the body area (where I want "test" displayed) and the actual template contents in raw text at the top of the page.

Where am I screwing up?

If you want this page displayed on customers side in skin1/cusotmer/home_main.tpl you have to specify which template to load when your new.php is called

{if $main eq "_mysearch_"}
{include file="path_to_file/mysearch.tpl"}
{/if}

Just look at the if statement there you will get the idea
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote