Page 1 of 2 12 LastLast
Results 1 to 10 of 361

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    oregon
    Posts
    12
    Plugin Contributions
    0

    Default Re: Easy embed template

    Quote Originally Posted by chas1 View Post
    Thanks for the comment, I am sure anyone who reads the rant will understand the major problems that are plaguing Zen Cart and an after thought if it can't be explained how do you expect anyone to write a step by step guide...
    Sorry for the inconvenience, Your assistance is no longer required a friend
    from California who is a webmaster is helping me(A PHP GURU).

    actually, all that's needed is a simple step by step.

    when i started reading this thread, i thought "wow, this sounds like exactly what i'm looking for." then i looked at the documentation, read through some of the other posts, and thought "WTF?'

    however, once i grasped it, i realized how brilliant this mod is, and how simple... mind-numbingly simple it is to implement.

    it works like this:

    1. create an html file in your website that you would like to embed zen cart into. let's call it shop.html and let's put it in the root of our website:
    - we can access this file from http://www.foo.com/shop.html
    - the file is found on the server at /path_to_your_files/shop.html

    2. somewhere in your html file, you need to put three very specific lines of text. WHERE you put them is up to you, but they must be together and they must be exact. the thing to know is that it goes in the body of the file, and that it goes where you want your zencart to go.

    <div id="content">
    <!-- START EMBED -->
    <!-- END EMBED -->

    3. install zen cart. i'm going to assume that you installed zen cart in a directory called zen. go to http://www.foo.com/zen and do all the zen installation stuff.

    DO NOT GO ANY FURTHER UNTIL YOU HAVE ZEN WORKING PROPERLY WITH THE DEFAULT TEMPLATE.

    4. once you have zen up and running, it is time to install the new template. the sang_embed template installs like any other template. please see the wiki if you need basic assistance with installing a template in zen cart (or better yet, buy the zen book, you won't regret it). essentially, you copy the template files to your webserver. most will go in zen/includes/templates/sang_embed, but the main thing is to match the folder structure in the download. don't forget to "turn on" the sang_embed template in the admin.

    5. make ONE change in the file named embed_config.php. you can find it at /path_to_your_files/zen/includes/templates/sang_embed/common/embed_config.php

    find the line that begins with $zc_temp (it is line 11) and change it so that it refers to the html file you created in step 1. in our example, it would be:

    $zc_temp = '/path_to_your_files/shop.html';

    THIS IS THE KEY. IT TELLS ZEN CART THAT IT MUST EMBED ITSELF IN THAT FILE.

    6. go test it by going to http://www.foo.com/zen

    7. revel in your brilliance

  2. #2
    Join Date
    Aug 2007
    Location
    oregon
    Posts
    12
    Plugin Contributions
    0

    Default Re: Easy embed template

    oh yeah, now i remember what i came to this thread for.

    i've run into a small problem with the template. the problem is related to the fact that the template puts a ../ in front of all links in the html file to make them work. this works great UNLESS you have a mailto link.

    the mailto link now reads http://www.site.com/mailto:[email protected]

    any ideas how to deal with this?

    thanks,

    d.

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

    Default Re: Easy embed template

    Urbanix,
    tank you for adding a positive light to this thread.
    I have not been here for a while so this is the first time I have seen your post.
    About the mailto: problem.
    I would tell you first not to use this code. there are bots that search the net and look for this code. they grab the email address and start sending it stock and pen1s (can you believe the real spelling is black listed?) advise like crazy. My advise is where every you would have a mail to, point it to a contact form, like the one that Zen cart comes w/. As a rule I never posy and email address on line.
    That being said if you don't mind complete strangers talking about how you please your woman, no matter who your are. the Whole embed_config.php is pretty clear and run on regex al you would have to do is replace the link re writing code w/ a new expression.
    That being said, regex is an art form that I barley comprehend (I am just not that lete). the embed_config program took me about 10 hours of hacking to figure out, and really it is not the best set of regex's in the world. I would suggest that you hang out in the #regex channel on free node and bug them.

  4. #4
    Join Date
    Aug 2007
    Location
    oregon
    Posts
    12
    Plugin Contributions
    0

    Default Re: Easy embed template

    my thoughts on mailto as well. however, i am not the lead on this project, i just make things happen. the designer has obfuscated the email address in a rather intresting manner. don't know if it'll work, but it'd definitely interesting.

    anyway, i had assumed as much about the regex (something i haven't touched in years). just had to hope that you were going to say "i fixed that in my secret magic version that i've been keeping to myself as insurance..."

    guess i'll get to find out just how badly they want this.

    thanks for all your work on this and your quick response to my question.

    d.

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

    Default Re: Easy embed template

    offer to sell them a multi person contact form, remind the designer nicely that a web sites art need to conform to function and not the other way around.
    I have obscured email addresses w/ images w/ .js w/ html character values, and still had spam sent to that address. and believe me it was not the box that was getting spammed. Show some (mock if necessary) concern about getting the end user the best product neccery.

    oh and another thing of you are not using the easy embed template on any other program then just comment out the link rewrites and make the links ../ your self.

    I am thinking that the next ver will just detect the dir structure and hard code the links in an absolute manner

    JOsh

  6. #6
    Join Date
    Nov 2007
    Location
    northern, CA
    Posts
    25
    Plugin Contributions
    0

    Default Re: Easy embed template

    First of all, I would like to thank ########################## for the time and effort involved in creating the script. And, Urbanx for the concise explanation - it is appreciated.

    I have have ZenCart installed in a directory named "catalog"
    I created an html file called "catalog" with the embed code.

    The sang_embed files have been installed under:
    /catalog/includes/templates/sang_embed/

    The Sanguine Embedded Cart is now the default template as indicated in ZenCart Admin area.

    Problem: when attempting to load catalog.php, my layout explodes and the sample data does not show.

    Any ideas? I must have some files in the wrong directory?

    Thanks!

  7. #7
    Join Date
    Aug 2007
    Location
    oregon
    Posts
    12
    Plugin Contributions
    0

    Default Re: Easy embed template

    Quote Originally Posted by EarlyFloyd View Post
    I have have ZenCart installed in a directory named "catalog"
    I created an html file called "catalog" with the embed code.

    The sang_embed files have been installed under:
    /catalog/includes/templates/sang_embed/

    The Sanguine Embedded Cart is now the default template as indicated in ZenCart Admin area.

    Problem: when attempting to load catalog.php, my layout explodes and the sample data does not show.

    Any ideas? I must have some files in the wrong directory?

    Thanks!
    ok, you've managed to confuse me. where did catalog.php come from? you should be creating an html file (you can call it catalog.html if you like), but you don't access that. just go to yourwebsite/catalog

    i hope that makes a bit more sense.

    d.

  8. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Easy embed template

    Quote Originally Posted by urbanx View Post
    oh yeah, now i remember what i came to this thread for.

    i've run into a small problem with the template. the problem is related to the fact that the template puts a ../ in front of all links in the html file to make them work. this works great UNLESS you have a mailto link.

    the mailto link now reads http://www.site.com/mailto:[email protected]

    any ideas how to deal with this?

    thanks,

    d.
    Disclaimer: I KNOW that it's not recommended to use "mailto" links.. As a practice I do not use them for my client's sites, and opt for a contact forum instead.. I already went through the CONS of this with my client and the Flash designer.. However, the Flash designer still wanted his site credit pointing to an e-mail address.. **sigh**

    So that said here's how to fix the above issue:
    Comment out the following lines in your "embed_config" file as follows:.
    Code:
    //JTS 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);
    I probably didn't have to comment all three lines out, but since I didn't know which specific line in this code block governs the replacement of the "mailto" links, I commented them all out, and tested my site.. So far everything is still working..

  9. #9
    Join Date
    Mar 2008
    Posts
    76
    Plugin Contributions
    0

    Default Re: Easy embed template

    Nice. I didn't check it out yet, but it looks good.

    Thanx.

  10. #10
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Easy embed template

    Thanks!!! Happy to share.. Not enough folks come back to show WHAT they did with this template, and I think it helps other people to see this template in use.. So I wanted to share.. Plus I really like how this site came out..

 

 
Page 1 of 2 12 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

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