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

YOU ARE HERE:
Easy PHP "Embedding"

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Easy PHP "Embedding" »
Welcome, Guest. Please Login or Register.
12/16/17 at 20:40:18
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   Easy PHP "Embedding"
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: Easy PHP "Embedding"  (Read 5224 times)
mayur
Silver Dragon
***

Gender: male
Posts: 31




   

WWW E-Mail
Easy PHP "Embedding"
« on: 03/22/07 at 11:42:07 »
Reply with quote Modify message

I've seen numerous posts about embedding your cpshop site into a php page.  Some explanations are lengthy some are short.

However, perhaps I am over simplifying things or maybe I just got lucky.  I have a solution I have implemented several times with absolutely no problems whatsoever...

In cpadmin, I have the default template set to a php file, i.e. cpshoptemplate.php.  The template is simple:


Code:
<!--cpshop template-->

<?php include("head.php"); ?>

<?php include("side.php"); ?>

<?php include("main.php"); ?>

<?php include("footer.php"); ?>


This works 100% fine for me and I am able to put any non-cpshop related php scripts into my templates with no problem at all.  Each one of the include files then contains the html/php/javascript or whatever else floats your boat.

This also allows me to better integrate cpshop into an existing website.  The only difference between the above cpshop template and another page on a website (a contact or about me page for example) is that the head.php file would be different (because I use the keyword and description template tags for the cpshop template file as well as title) and the main.php file is different.

Here are the contents of my cpshop template main.php file:


Code:
<[content]>


Simple, eh?

The flow of the site is then much cleaner -- it all looks the same.  For the rest of the site, I'll have the same sort of template for each page except I'll have, obviously, a different head.php and main.php (regularhead.php and main_about.php / main_contact.php for example).

As far as loading your cpshop.cgi file, I have also been able to load that through a php file with simple:


Code:
<?php include("cpshop.cgi"); ?>


Considering how easy the above solution is, I think I may be missing the overall picture of the confusion and difficulty of php embedding...
« Last Edit: 03/22/07 at 11:45:35 by mayur » Logged

http://desirage.com/
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Easy PHP "Embedding"
« Reply #1 on: 03/22/07 at 20:43:57 »
Reply with quote Modify message

That's a clever template, Mayur, but embedding occurs when you attempt to place cpshop-generated output directly into non-cpshop pages/sites, as in a forum, blog or CMS (eg: Joomla, phpnuke, etc.), or in the sidebar of a static page.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
mayur
Silver Dragon
***

Gender: male
Posts: 31




   

WWW E-Mail
Re: Easy PHP "Embedding"
« Reply #2 on: 03/23/07 at 05:50:06 »
Reply with quote Modify message

I see, Hex, thanks.

If that's the case, why couldn't you simply use the cpshop.cgi include above with a template with simply <[content]>?
Logged

http://desirage.com/
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Easy PHP "Embedding"
« Reply #3 on: 03/23/07 at 06:52:00 »
Reply with quote Modify message

You can, but there are caveats (eg: cpshop outputs a table format that isn't always ideal for the design/application the data's being imported to) and advanced cpshop issues (eg: you may need to setup the shopids in a particular way to get the output format you want, or perhaps create a new cpshop instance). That's what all the discussion is about.


Cheers,

p.
« Last Edit: 03/30/07 at 18:39:49 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
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.