marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
centralized menu

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « centralized menu »
Welcome, Guest. Please Login or Register.
12/14/17 at 08:21:09
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   centralized menu
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: centralized menu  (Read 1674 times)
surfscape
Silver Dragon
***

Posts: 27




   

WWW
centralized menu
« on: 12/14/05 at 11:11:15 »
Reply with quote Modify message

Ok, I'm a newb at cpshop. I have created a site, with a homepage, faq, blah, blah, blah. The menu is really the only thing I need to manage centrally, so I've place the menu links in a seperate file and use a php include to place it in the site, works fine for the non cpshop pages.  I was under the impression that changing the extension on my template to .php and inserting the include would work in cpshop (http://www.marty.net/cgi/marty/board/messageboard?board=cpperl&action=display&num=1128841484), alas no menu. I want this menu to be on all pages (store and static pages).

How best to accomplish this so I manage the menu in 1 file. Does NOT have to be a PHP solution.
« Last Edit: 12/14/05 at 19:52:47 by surfscape » Logged

Scuba Diving Apparel and Gifts
Bradley W. Schenck
Gold Dragon
****

Posts: 242



Go Scots!
   

WWW
Re: centralized menu
« Reply #1 on: 12/17/05 at 10:07:05 »
Reply with quote Modify message

Server side includes work just fine; I save my templates as .shtml, and usually have separate includes for left menu, right menu, and footer.
Logged
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: centralized menu
« Reply #2 on: 12/28/05 at 07:43:02 »
Reply with quote Modify message

use the full URL to your php file, like http ://yoursite.com/path/to/includenav.php  or whatever it is.  My entire store is php driven includes:
http://www.astphotos.com/store/
« Last Edit: 12/28/05 at 07:44:03 by Tony » Logged

----------------
http://www.astphotos.com
surfscape
Silver Dragon
***

Posts: 27




   

WWW
Re: centralized menu
« Reply #3 on: 12/28/05 at 09:33:13 »
Reply with quote Modify message

Thanks Tony,

I finally figured that out, it took me a few visits to realize the search only searches 7 days by default, wondered why I rarely got results.

Anyway that should be stickied someplace prominent, seems to be answered over and over.

BTW, I really like your store design, very well done.

Garrett
Logged

Scuba Diving Apparel and Gifts
drewf
Green Dragon
*

Posts: 4




   

PHP Include Problem
« Reply #4 on: 12/06/06 at 13:03:27 »
Reply with quote Modify message

I'm ressurecting an almost year old topic, because I can't seem to get this to work. I'm using the following code in my php template files for cpshop:

<?include("http://mysite/sidebar.shtml")?>

If I go to the page on its own (not using cpshop.cgi) the SSI works fine. When I go to cpshop.cgi the include doesn't work. I can see the text for the include in the source, so it appears cpshop is preventing the execution of the PHP include.

I'm sure I am just missing something really basic, but I'm stuck. Can anyone help?

Logged
drewf
Green Dragon
*

Posts: 4




   

Re: centralized menu
« Reply #5 on: 12/06/06 at 14:20:44 »
Reply with quote Modify message

An update: It's not just getting the include to work, it's getting any PHP code to work. Any suggestions?
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: centralized menu
« Reply #6 on: 12/06/06 at 14:51:33 »
Reply with quote Modify message

Talk to your webhost.  They may be having a problem running PHP right now.  I've seen that happen before.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
drewf
Green Dragon
*

Posts: 4




   

Re: centralized menu
« Reply #7 on: 12/06/06 at 14:56:18 »
Reply with quote Modify message

Would it be a webhost issue if the PHP works outside of cpshop? Thinking about it more, is it even possible to execute PHP within a CPshop template file, or is this a reason to include CPshop into PHP?
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: centralized menu
« Reply #8 on: 12/06/06 at 15:35:20 »
Reply with quote Modify message

Wait a moment -- you're trying to run PHP within a template?  No, that won't work.

If you want PHP to preprocess your template, you have to enter it into cpshop as a fully-qualified URL, instead of a file location.

http://www.mysite.com/cptemplate.php

Then cpshop grabs the template after PHP has already processed it.
« Last Edit: 12/06/06 at 15:36:52 by Marty » Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
drewf
Green Dragon
*

Posts: 4




   

Re: PHP Include Problem
« Reply #9 on: 12/06/06 at 15:52:38 »
Reply with quote Modify message


on 12/06/06 at 13:03:27, drewf wrote:
I'm sure I am just missing something really basic, but I'm stuck.


Fully qualifying the URL for the template file did the trick. I knew it had to be something simple that I was overlooking. Thanks Marty!
Logged
keeb
White Dragon
**

Posts: 20



Go Scots!
   

Re: centralized menu
« Reply #10 on: 04/08/08 at 18:26:17 »
Reply with quote Modify message

(I'm posting on a thread from 2006! Wow.)


So I followed Marty's instructions to drewf above, using full URL instead of file location for my template.

But this only works for the product template and thumbnail template.  It doesn't work for cpfilter_template.

Is it possible to use php templates using cpfilter_template??
Logged
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright © 2000-2001, X-Null. All Rights Reserved.