Forums / Addon Templates / Easy embed template

Easy embed template

Locked

Views: 112,629

Results 21 to 40 of 362
This thread is locked. New replies are disabled.
25 Sep 2006, 10:54 PM
#21
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Easy embed template

Created a generic.html file. Add the embed tags
unzipped the Sanguis embedded template and edited the 1 line to point to my generic.html file
Used the ZenCart admin to install the Sanguis template.
Now I navigate to the homepage and see that the stuff from the Generic.html is being used as a warapper. VERY cool!
Did all that and get the following message at top of cart
Warning: filesize(): Stat failed for http://localhost/generic.html (errno=2 - No such file or directory) in C:\sokkit\site\zen13\includes\templates\sangembed\common\embed_config.php on line 15
Did I miss something out?

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

26 Sep 2006, 12:58 AM
#22
brain21 avatar

brain21

New Zenner

Join Date:
Sep 2006
Posts:
42
Plugin Contributions:
0

Re: Easy embed template

I got the same thing. What you have to do is figure out where your PHP root directory is. It goes from there. For example, my generic template path that I put in the php file was something like:

../../../../htdocs/storename/store/generic/generic.html

where the ../ backed me up 1 directory. The php root directory turned out to be something like

xampp/php/bin/php or something like that (I can't remember).

Look for the file php.ini.

For example lets say that your generic.html file is located in

/mysite/store/includes/templates/generic/gerneric.html
and lets say the php.ini file is located in
/mysite/store/php4/bin/php/

OK, now the script (rather the embed_config.php file) needs to know the path from the PHP root directory.

Look at the embed_config.php file where it says MY_TEMPALTE (it's supposed to say MY_TEMPLATE but there is a typo). You'll see that it is in single quotes. Within those quotes is where you need to put the path FROM the php root directory TO the generic.html file

OK, so php.ini is in the /php/ directory. We start off with a

../

that moves us from /mysite/store/php4/bin/php/ to /mysite/store/php4/bin/

OK, now we add one more ../ so it looks like

../../

that moves us from /mysite/store/php4/bin/ to /mysite/store/php4/

Now we add another & get

../../../

that moves us from /mysite/store/php4/ to /mysite/store/

OK, now store is a common directory for both files, so instead of backing out of the php directory like we did by using "../" we can now move forward.

we have

../../../

and that puts us in /store/

Now the generic.html file is located in

/mysite/store/includes/templates/generic/gerneric.html

We are already in the store directory, so now we just need to add the rest of the path, which is includes/templates/generic/generic.html (remember we are pointing to the html file so that's what we need).

add the two together and you get

../../../includes/templates/generic/gerneric.html

Now, put that between the single quotes in the embed_config.php file. Save the file. Go into your ZenCart Template stuff and click on edit and then update. Refresh your page.

Now those errors should be gone.

Brain21

26 Sep 2006, 8:00 AM
#23
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Easy embed template

Now those errors should be gone.
Thanks brain21.. sorted..after your excellent explanation..
:yes:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

26 Sep 2006, 2:58 PM
#24
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

To every one sorry about the delayed response. Developing web sites and hosting is my full time job. and when I am spending time answering questions, does some times fall to the side, when a bill needs to get payed.
as for your questions I will do my best to answerer them although there are are quite a few. Brian since you have become help full to others I will be helpful to you first.

brain21:

...OK, now what files got edited? IOW, how is this working?...
...So what file got changed and where?...
Brain21
No files was permanently changed. what this program does is on the fly:

  • reads the template file it pointed to and put in in to memory as a var.
  • It first scans the template variable, and looks for redundant parts that the zen cart already has (like doc type)
  • it then goes through and looks for links ands images located in the same directory or child directory's (./) and makes it look one directory back (../)
  • then it looks for other patterns, like <head> tags <body> tags and the EMBED comments and splits up the directories in to a number of variables.
  • in the tpl_main_page.php file thees variables are echoed in the right places.
    this is all done using what are known as Regular expressions
    if you wanted to use the sang embed file else where, on different Php written programs you can. I have used it on both Gallery2 and Phourm. you just have to include the sang embed at the top of the template and echo you vars. (Note this can be trick in various template engines like Smarty. I don not plan of providing my support for this.)

As for styles, the CSS that I have modified w/ this template file comes w/ a few things pre set. the main template banner is set to not show up. Some of the other tags (like <a>) that have been changed over all been deleted, so that you main style sheet will be more able to control the ZC. you will still need to tweak this to make it perfect.

brain21:

How would I say, create a product_info.php page
the old fashioned (zen) way.
you will make a copy of the template_default/templates/tpl_product_info.php, to sang_embed/templates/ and mod ify it manually.
this program dose very little for the inside of the zen cart.
but it does a lot for the out side. it still takes me about 4-5 hours all together to tweak the styles sheet and all the internal mods.
JOsh
PS there is more to come but I got to get to work.

JOsh Beauregard
Sanguis Development

26 Sep 2006, 4:31 PM
#25
brain21 avatar

brain21

New Zenner

Join Date:
Sep 2006
Posts:
42
Plugin Contributions:
0

Re: Easy embed template

Some weirdness:

My page is basically organized like so:

<head>run scripts & stuff</head> <body>

Here is the top navigation part of the page, backgrounds, etc.

<!--Start embed -->

ZenCart stuff goes here

<!-- end embed -->

Here is the footer stuff, i.e. my nav links at the bottom of the page.

</body>

After loading up the Sanguis template I see the page as described above with the following exception:

<body> footer stuff top nav stuff <!-- embed --> zencart stuff <!-- end embed --> footer stuff </body>

So why is my fo0ter stuff appearing at the top of the page as well?

It may be worth noting that basically the entire body of the page is in a centered table to keep the contents in the center of the page. I looks like the "extra" footer stuff is being place BETWEEN the initial <body> tag and the initial opening <table> tag.

Weird.

Thanks,

Brain21

26 Sep 2006, 5:08 PM
#26
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Easy embed template

The only problem I still have is also with footer.. certain links are placed
on top of other links, and in incorrect order to normal zencart 1.3* template

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

26 Sep 2006, 5:16 PM
#27
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

misty:

The only problem I still have is also with footer.. certain links are placed
on top of other links, and in incorrect order to normal zencart 1.3* template
can you give me a link so that I can look at the problem?

JOsh Beauregard
Sanguis Development

26 Sep 2006, 9:14 PM
#28
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Easy embed template

can you give me a link so that I can look at the problem?
Currently on localhost, would a screenshot suffice or your wish to view source
code?

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

26 Sep 2006, 9:22 PM
#29
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

misty:

Currently on localhost, would a screenshot suffice or your wish to view source
code?
a little of both actuly
could youmake a zip for me?
JOsh

JOsh Beauregard
Sanguis Development

26 Sep 2006, 9:36 PM
#30
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Easy embed template

a little of both actuly
could youmake a zip for me?
JOsh
Late here in UK, tomorrow will add to test site and send you
url via pm.. further testing earlier this evening reveals works
very well viewed in Internet Explorer, but not via Firefox.
Now must get some
:sleep1:
before attempting to work out tomorrow, path to php
on paid linux server

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

27 Sep 2006, 4:48 AM
#31
pitsta avatar

pitsta

New Zenner

Join Date:
Sep 2006
Location:
Melbourne, Vic, Australia
Posts:
3
Plugin Contributions:
0

Re: Easy embed template

Hi All....

Must say GREAT thread!!!!

learnt a lot from u guys....thanking u'll!!!! Great stuff Josh.

I have the same problem as Misty and brain21......my footer is also showing up the top......hmmmm

Any suggestions???

http://testshop.icwebs.com.au/shop/

Cheers
Shaun

27 Sep 2006, 2:05 PM
#32
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

oh....
now I get it, I was thinking that text was over lapping orther text, not the fotter appering on the top of the page.
I will take a look at my code
I bet you the prblem is there
Josh

JOsh Beauregard
Sanguis Development

28 Sep 2006, 12:16 AM
#33
pitsta avatar

pitsta

New Zenner

Join Date:
Sep 2006
Location:
Melbourne, Vic, Australia
Posts:
3
Plugin Contributions:
0

Re: Easy embed template

Ur a Champ!!!

thanks Josh

Shaun

28 Sep 2006, 12:04 PM
#34
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

not the fotter appering on the top of the page.
wow I said fotter! (I tend to spell check posts now a days)
OK I have an Idea, but unfortunately I don't have an un working copy of this code.
so here is my Idea.
Comment out line 60 of sang_embed.php
let me know how it goes.

JOsh Beauregard
Sanguis Development

28 Sep 2006, 12:19 PM
#35
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Easy embed template

Comment out line 60
Line 60 for me is

eval ('?>' . $sitetemplate_bottom);

No, places text.. ' . $sitetemplate_bottom); ?>..
at top of page..
Comment out

$sitetemplate_bottom = preg_replace('/^.*<!-- END EMBED -->/s', '', $sitetemplate);

works fine and fixes problem viewing via firefox
:smile:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

28 Sep 2006, 12:57 PM
#36
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

Just in.
I will be installing a new ZC today, so I will have a cnace to work on this. yay for all!

JOsh Beauregard
Sanguis Development

29 Sep 2006, 2:35 AM
#37
pitsta avatar

pitsta

New Zenner

Join Date:
Sep 2006
Location:
Melbourne, Vic, Australia
Posts:
3
Plugin Contributions:
0

Re: Easy embed template

okay.....cheers for that!!!

I actually commented out the following:

eval ('?>' . $sitetemplate_bottom);

....and works great!!!!

29 Sep 2006, 12:36 PM
#38
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

eval ('?>' . $sitetemplate_bottom);
as I said quote out line 60 adn it should work

JOsh Beauregard
Sanguis Development

17 Nov 2006, 11:09 PM
#39
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

Ok guys,
I have been thinking.
the Sang_embed template currently adjusts links and images in the template file that it is pointed to so that they all have a "../" the beginning of them
I am about to put together a 1.2 version of the template for down loading. should I 86 that feature?
the down side is that images and links made to be relative, will not work, and all inks and images will have to be made absolute. the good thing about this is there will be no more playing w/ the format of your lings and getting things like "href=.././page.html" in you mark up.

tell me what you think.

JOsh

JOsh Beauregard
Sanguis Development

27 Mar 2007, 1:47 PM
#40
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Easy embed template

is there still any interest in this add on I am about to be working on it and will be putting out an updated ver if people want it. other wise, I will not bother.

JOsh

JOsh Beauregard
Sanguis Development