Page 1 of 3 123 LastLast
Results 1 to 10 of 361

Hybrid View

  1. #1
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Easy embed template

    HI there,
    Though out last year I had developed an 'easy embed template' for Zen Cart 1.2.x.
    All you had to do was define a template file for your site in the config, and through a long set of REGULAR EXPRESSIONS it would put what ever you had for the rest of your site around your zen cart. embedding it in in site of the master template.
    Well for ver 1.3.x I am going to realease that code. this is the starter thread.
    below I am going to paste all the expressions, please feel free to make any suggestions as, I stumbled through making them and could use the communities help.

    JOsh

    PHP Code:
    //strip some duplicate tags that zen cart manages itself 
    $sitetemplate=preg_replace('/<!DOCTYPE.*?>/si'''$sitetemplate);
    $sitetemplate=preg_replace('/<meta.*?>/si'''$sitetemplate);
    $sitetemplate=preg_replace('/<html.*?>/si'''$sitetemplate);
    $sitetemplate=preg_replace('/<title.*?title>/si'''$sitetemplate);


    //Sangus: replace hrefs to point above catalog, but not the href for the style sheet! or http links!
    $sitetemplate=preg_replace('/href="/si''href="../'$sitetemplate);
    $sitetemplate=preg_replace('/href="..\/..\//si''href="../'$sitetemplate);
    $sitetemplate=preg_replace('/href="..\/http/si''href="http'$sitetemplate);

    //replace last bits: img src
    $sitetemplate=preg_replace('/src="images/si''src="../images'$sitetemplate);
    $sitetemplate=preg_replace('/<!-- START EMBED -->/si''<!-- START EMBED -->'$sitetemplate);
    $sitetemplate=preg_replace('/<!-- END EMBED -->/si''<!-- END EMBED -->'$sitetemplate);

    //creates bits for the had and the body
    $sitetemplate_head preg_replace('/<\/head>.*$/s'''$sitetemplate);
    $sitetemplate_top=preg_replace('/<!-- START EMBED -->.*$/s'''$sitetemplate);

    //replicats info fot the body tag atributes
    preg_match('/<body([^>]+)>/'$sitetemplate$sitetemplate_body_pre) ;
    $sitetemplate_body =  $sitetemplate_body_pre['1'];
    $sitetemplate_body preg_replace('/images/s''../images'$sitetemplate_body);

    //strips the head info from the body
    $sitetemplate_top=preg_replace('@<head[^>]*?>.*?<body.*?>@si'''$sitetemplate_top);
    $sitetemplate_top=preg_replace("@,'images/@si"",'/images/",  $sitetemplate_top);

    //strips the head info from the body
    $sitetemplate_head=preg_replace('@</head>@si'''$sitetemplate_head);
    $sitetemplate_head=preg_replace('@<head>@si'''$sitetemplate_head); 

  2. #2
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: Easy embed template

    ##########################-

    I really hate to sound lame, but after reading and re-reading your post - I have absolutely no idea what you are talking about. Nor do I understand what you're supposed to with the lines of code.

    Any further info on what and how this works would be appreciated.

    thank you,

    Betty

  3. #3
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Easy embed template

    fair enough.
    I tend to murder written communication.
    what this is is a template program that make its very easy to add a zen cart to and existing web site. this is more for people who already have a look and feel that they like, and just want to stick zen cart into the "content' are of their site and have it surrounded but the rest of their site.
    In example. Joe had a site a/ a few pages on it and he has a pay pal style shopping cart that lists all his products and has the normal add to cart & check out buttons (ie http://www.estesjewelry.com)
    say the client want to upgrade to zen cart but does not want to loose her current layout. this template would make it very quick and easy for her to install ZC and then have her lay out wrap around the zen cart that just replaces the pay pal part of her site.
    I know that one can do this by just copying an pasting things into the tpl header and footer, but once you do that one can not rely on Dream Weaver template files any more and when ever a Graphic designer, (who does not care to know php) makes and update to the whole site the Zen cart does not get updated until a developer goes and cuts and pastes things in again.
    so this template program takes one file that has a
    HTML Code:
    <HTML>
    <head>
    </head>
    <body>
    <lay out top>
    <zen cart>
    <lay out foot>
    </body>
    </HTML>
    set up and does all the cutting for you it also will redirect their links/images to work in a sub directory, via the above regexps.

    I hope this is clear now what the bennifit is.
    I will post the code as soon as I have a the time to make and unbranded version.

    JOsh

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Easy embed template

    Looks like a PayPal site ... so what was gained here?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Easy embed template

    that was just an example of a site that had a paypal site, the rest of the upgrade was all for your imagination. sole of the site running the old embed template are.
    llamafantics.com,
    moosepaws.com,
    delightsoftheearth.com,
    hsrc.biz
    cleverwares.com

    the list goes on

    JOsh

  6. #6
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: Easy embed template

    ##########################-

    Thank you for the excellent explanation, I get it now !!

    Sounds like a really nice addition. There are so many attractive eCommerce templates that currently cannot be used for Zencart. Hopefully this will enable us to give ZC a more updatred and unique look!

    Thank you again for the explanation. Also, will you not be releasing the pre-1.30 version?

    Betty

  7. #7
    Join Date
    Jan 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Easy embed template

    Previous to my earlier post: yes, I was pulling out the wrong hair. The path I had given was correct.

    Actually, I had hit a snag when some fussy parser gizmo somewhere in the innards of the system didn't like the doctype declaration it found in my template store.html (that's used on the rest of the site pages) which caused it to burp out gibberish. When I removed such finery and my template doc started simply

    <html>
    <body>

    why then suddenly I was a brilliant engineer and worth every penny again.

    Thanks to Josh and all. This should be built-in to zen cart.

  8. #8
    Join Date
    Jan 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Easy embed template

    Well, I'm fired again.

    It is finding my template, but I'm getting weird results and some images show up, some do not (though all are in the same directory and show up in the template file when it's viewed directly).

    I'm seeing this when I view the source in my browser:

    ' . $sitetemplate_bottom);
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
    <head>
    <title>Zen Cart!, The Art of E-commerce</title>

    Sigh. So near and yet...

  9. #9
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Easy embed template

    How about having a look at this:
    https://svn.rubikintegration.com/zen.../ytemplate.php

    you can do something like this:
    say you have the page contact us, you can have:
    ..........page header
    file content is automatically rendered depending on the $_GET["action"] or can be set.
    ..........page footer
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  10. #10
    Join Date
    Jan 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Easy embed template

    I just did a fresh default install of zencart, adding only the easy embed templates.

    When I switch to the embed template I get

    ' . $sitetemplate_bottom);
    ?>

    output to the very top of the page before the <!DOCTYPE... declaration. This happens if my store.html template is present or not.

    So it's a dead end to me. I have no idea how to fix that.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Embed php template within another php template based on drop-down menu selection?
    By mcqueeneycoins in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 21 Jan 2012, 06:44 PM
  2. Embed cart button to old site is easy! if no atributes
    By medragon in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 9 Jun 2009, 06:21 AM
  3. How easy is it to install a zen-cart template?
    By ssbeats in forum Addon Templates
    Replies: 1
    Last Post: 22 Nov 2007, 09:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR