Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hmmm, a new release. I wonder if it will fix the problems I have posted here and not gotten resolved.

 

1- I cannot make the "Click to Enlarge" feature work. Multiple posts in this thread, no solution as of yet...

 

2- I just checked to see if the rest of my website is at least functioning correctly. It was all functioning correctly before adding STS. But now, since I added a different login image on the home page to replace the one I had on my original site, it takes you to the wrong (original)login page. When you click on the new snazzy image, you are taken to the old login page. I have no clue how to tell it to get to the correct login page. Perhaps this broke an earlier contribution? Who knows, I certainly don't.

 

As far as I am concerned, my website now looks great, but it is broken in multiple places. STS is leaving a bad taste in my mouth.

Did you try putting the javascript for the click to enlarge directly in the sts_template.html file? I had that problem and it fixed it.

 

Have you tried the debug features? You can turn the sts on and off with the debug on and get quite a bit of info on what is going on with your site.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Hmmm, a new release.  I wonder if it will fix the problems I have posted here and not gotten resolved.

 

1-  I cannot make the "Click to Enlarge" feature work.  Multiple posts in this thread, no solution as of yet...

 

2-  I just checked to see if the rest of my website is at least functioning correctly. It was all functioning correctly before adding STS.  But now, since I added a different login image on the home page to replace the one I had on my original site, it takes you to the wrong (original)login page.  When you click on the new snazzy image, you are taken to the old login page.  I have no clue how to tell it to get to the correct login page.  Perhaps this broke an earlier contribution?  Who knows, I certainly don't.

 

As far as I am concerned, my website now looks great, but it is broken in multiple places.  STS is leaving a bad taste in my mouth.

Did you try putting the javascript for the click to enlarge directly in the sts_template.html file? I had that problem and it fixed it.

 

Have you tried the debug features? You can turn the sts on and off with the debug on and get quite a bit of info on what is going on with your site.

same for me - you have to put everything like css and javascript into the header of your template.html - otherwhise you'd have problems - had the same problem - that solved it... ;)

Link to comment
Share on other sites

are there any sts files or folders that should be blocked with our robots.txt. file?

Nope. None of it ever gets called directly.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Does?nt anyone have any suggestions on this one?  ;)

I would like to have the "my account", "check out" and the "cart contents" in graphical buttons instead of text links. Support for multiple languages is a must.

 

 

thx B)

So why can't you use $myaccountlogo $cartlogo and $checkoutlogo ?

Cause I need to have the buttons in diffrent languages ;)

Is that possible? Were do you define new images?

You could add a new template variable for the language id (say, "$langid") in sts_user_code.php:

 

  $template['langid'] = $languages_id;

 

and then in your sts_template.html file do something like this for each button's HTML IMAGE tag like:

 

<img src="myaccount$langid.gif">

 

Then you could create myaccount1.gif, myaccount2.gif and myaccount3.gif, one for each language...

 

Best I can think of off the top of my head!

 

- Brian

 

PS: I'll add the $langid tag in the next version too (in sts_display_output.php)

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

is there any way to force the main sts template to parse php on the page. I have a javascript that is partially generated by php and making anew box would exxentially require me to rewrite the javascript. I need to place the JS on the template and have the php parsed tomake it work.

 

is there any way to forse STS to parse php that is directly located on the template file?

STS will not parse any PHP in any template file. In fact, it will pass the PHP code through directly to the user without stripping it out, which might expose information you don't want exposed. There is really no way to get around this the way STS is built.

 

If you want this ability, you can fake it by putting the code you want to generate in sts_user_code.php and assigning the output to a template variable, and then including that variable on your template page.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

How to add new Template Tags into product_info ?

 

Does anybody know how to add new Template Tags into

the product_info.php.htm? Where do they have to be defined?

 

For example I?d like to add an addidtional picture in case there?s

one in the database for the product. Let?s call it $addpicture.

Where do I have to define it that I can add it to the product_info.php.htm ?

 

 

Thanks a lot for your answeres !

 

:-) NewToon

The tags are defined in sts_product_info.php

 

Anything new you'd want to add would go in there. The file is basically a stripped down copy of the stock product_info.php that comes with OSC, but with everything but the variables removed and the STS template code added.

 

It's not too difficult to change things in there.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

How to add new Template Tags into product_info ?

 

Does anybody know how to add new Template Tags into

the product_info.php.htm? Where do they have to be defined?

 

For example I?d like to add an addidtional picture in case there?s

one in the database for the product. Let?s call it $addpicture.

Where do I have to define it that I can add it to the product_info.php.htm ?

 

 

Thanks a lot for your answeres !

 

:-) NewToon

The tags are defined in sts_product_info.php

 

Anything new you'd want to add would go in there. The file is basically a stripped down copy of the stock product_info.php that comes with OSC, but with everything but the variables removed and the STS template code added.

 

It's not too difficult to change things in there.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

OK, I used product_info.php.html to lay out my product pages.  I got the Click to Enlarge text to show up, but it seems I am missing something, because when I click on the link, it just takes me back to the Home Page.  I thought product_info.html.php was supposed to help you lay out your Product pages just by using html.  But it seems some code is missing?

 

Did the Click to Enlarge function work on previous versions of STS, and just got broken in 2.0, with the product_info.php.html feature?  Any advice would be great, as I am pulling my hair out trying to fix this.

 

You can see this in action here:

My Webpage, and click on any product.

You need to add the javascript for the popup code into the <head> section of your product_info.php.html file:

 

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>

 

Then, you need to add the following (you might need to play with the popup_image.php path) to make your popup link:

 

<a href="javascript:popupWindow('popup_image.php?pID=$productid')">Click to Enlarge</a>

 

Then, create the new $productid variable in sts_product_info.php by adding this line somewhere in the file (will work anywhere):

 

$template['productid'] = (int)$HTTP_GET_VARS['products_id'];

 

See if this help.

 

- Brian

 

PS: I'll add the $productid variable to the next release of STS.

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Hi Brian!

 

First: great great great contrib!

I know that sts doesn't work with coolmenu - just found out and then found it on the dynamic-sea page.

I looked through the code and saw that it would take it's time to figure out how to get coolmenu to work.

What I wanted to ask, (bec. I don't have that much time to wait for a fix) is:

Could you give me a hint what the problem is?

I looked things through - coolmenu generates it's code as it should

STS puts everything except this code where it should be

and thats the problem - sts puts everything in it's right place (even the coolmenu environment), except the menudata generated by coolmenu.

Maybe you can give me a tip what the problem is and I would be much faster to work it out and give it back to you and the community!

In the meanwhile I have lots of other things to do and am curious to your answer!

Thanks in advance! STS made things very easy and the shop project I'm working on isn't looking like all the other OSC shops anymore!

 

I haven't had a chance to work with Coolmenu (and today's no exception, as it is now 5AM here and I haven't made it to bed yet).

 

You say that it's menu data isn't going where it should. Can you just capture that date with a STS_RESTART_CAPTURE command block (like you see in the column_left.php and other files), assign it to a variable and just put it where it needs to go?

 

I know I'm not loads of help on this one. Sorry...

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

I dont know what this menu contrib is, but why dont you just design a menu and install into the catagory box, I havnt a system as a demo but I have tried this and it works great.

 

I am working on a site at the moment which I wasnt goin to use this type of menu but hey what the hell, I will install a dhtml menu to the cat box and post here the link k.

Link to comment
Share on other sites

I dont know what this menu contrib is, but why dont you just design a menu and install into the catagory box, I havnt a system as a demo but I have tried this and it works great.

 

I am working on a site at the moment which I wasnt goin to use this type of menu but hey what the hell, I will install a dhtml menu to the cat box and post here the link k.

wow - sounds great!

 

 

...both ideas seem to be very good!

 

 

@brian I'll try to capture it like you mentioned - maybe this will work but I think I'll have to put the whole javascript code in the head of my template.html - bec. otherwhise it wouldn't work - i think

 

 

@joker

 

looking forward to your reply - I'd really liket to see that! :rolleyes: :D

 

 

to both: thanks for fast replys!!!

Link to comment
Share on other sites

@brian - the capture didn't work - i tried it out - what the menu does is:

 

it simply takes the data of the categories like the categories box usually does...

 

...the only thing it does differntly is, that it formats it into javascript instead of tables or breaks...

 

...so it should work, but it does not - somehow - I mean - maybe I made a mistake, but I saw some other people complaining and also that it's a feature request for sts - so I thought it wouldn't be my fault - I don't know what the exact problem is - very strange

Link to comment
Share on other sites

QUOTE (Karlin @ May 27 2004, 03:42 PM)

OK, I used product_info.php.html to lay out my product pages.  I got the Click to Enlarge text to show up, but it seems I am missing something, because when I click on the link, it just takes me back to the Home Page.  I thought product_info.html.php was supposed to help you lay out your Product pages just by using html.  But it seems some code is missing?

 

Did the Click to Enlarge function work on previous versions of STS, and just got broken in 2.0, with the product_info.php.html feature?  Any advice would be great, as I am pulling my hair out trying to fix this.

 

You can see this in action here:

My Webpage, and click on any product.

 

 

You need to add the javascript for the popup code into the <head> section of your product_info.php.html file:

 

 

CODE 

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

 

 

 

Then, you need to add the following (you might need to play with the popup_image.php path) to make your popup link:

 

 

CODE 

<a href="java script:popupWindow('popup_image.php?pID=$productid')">Click to Enlarge</a>

 

 

 

Then, create the new $productid variable in sts_product_info.php by adding this line somewhere in the file (will work anywhere):

 

 

CODE 

$template['productid'] = (int)$HTTP_GET_VARS['products_id'];

 

 

 

See if this help.

 

- Brian

 

PS: I'll add the $productid variable to the next release of STS.

 

OK, this worked, but I noticed 2 things:

1- The entire website is suddenly running much slower. I verified the slower performance with another person at an entirely different location to make sure the cause of it was not my computer, my connection, etc.

 

2- How do I make it so that the customer can click on the image (in the Product Description page) or the text link for a popup window? This way, the site remains consistent in functionality.

Link to comment
Share on other sites

OK, this worked, but I noticed 2 things:

1-  The entire website is suddenly running much slower.  I verified the slower performance with another person at an entirely different location to make sure the cause of it was not my computer, my connection, etc.

 

2-  How do I make it so that the customer can click on the image (in the Product Description page) or the text link for a popup window? This way, the site remains consistent in functionality.

 

1- I know of no reason that this should have any effect on speed. All it is is one variable assignment on the server side, and some simple javascript and an anchor tag on the client side. If you take it back out, does it speed back up? Sounds like the problem is coming from something else to me...

 

2- Just put the <a href=....> stuff around your image, or anything else you want to bring up the window. You can have as many different items on the page as you like.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

I've had great success formatting my site with STS, thanks so much.

I've got a challenge now and I dont' know where to go, unfortunately I'm not sure if its with STS or not. My create_account.php page won't process and post the inputs to the database and I cannot create an accout. After hitting continue the warning minimum field notices come up. Any ideas....

 

Thanks.

Link to comment
Share on other sites

I've had great success formatting my site with STS, thanks so much.

I've got a challenge now and I dont' know where to go, unfortunately I'm not sure if its with STS or not. My create_account.php page won't process and post the inputs to the database and I cannot create an accout. After hitting continue the warning minimum field notices come up. Any ideas....

 

Thanks.

If you look at the HTML source, are the form tags and everything where they should be?

 

If you turn on STS Debugging, what is in $output?

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

About 9 months ago I was laid off. The girl that I worked with for the last 3 years and I decided to start our own company, M&M merchandising. Firt week we had 3 employees, second week 15, after the first month 87 in three states with over 200 work orders. Seems we carried over our the companys manufactures to us to supply 3rd party labor for there products. We're now nine months old and it still has it's ups and downs but at least we are showing profit and keeping 87 people emploied. I also do government projects on the weekend doing a little flying.

 

I've been cutting vinyl for about 3 years for model airplane clubs and there members and finally upgraded my cutter from a 15 inch to a 24" so I can cut big graaphics. All that and run a business, but lots of fun just meet and working with a lot of different people.

 

Guy

Link to comment
Share on other sites

I've turned debugging on and I'm not sure where to look for $output.

 

 

 

Here's the link to the page /create_account.php page w/ debugging on.

 

http://www.tearetreat.com/catalog/create_account.php (Tea Retreat)

 

Thanks for the effort

 

Sorry, I should have said $content. (I work with too many different systems! ;) )

 

Here's how to debug this stuff:

 

First, you can turn on debugging manually in your browser by changing the URL from:

 

http://www.tearetreat.com/catalog/create_account.php

 

to

 

http://www.tearetreat.com/catalog/create_a...php?sts_debug=1

 

This will turn it on for just your session, and nobody else on the site will see the debugging code.

 

$sts_block['columnleft2columnright'] - This block shows what was captured by STS between the left and right columns. You should see everything needed for your $output variable in this section. If not, something is wrong, probably in the php files that generated it.

 

In this case, I'm looking at this section:

 

<!-- left_navigation_eof //-->

    </table></td>

<!-- body_text //-->

    <td width="100%" valign="top"><form name="create_account" action="http://www.tearetreat.com/catalog/create_account.php?osCsid=20baeaef7bb71b3846e5633aedf0c860" method="post" onSubmit="return check_form(create_account);"><input type="hidden" name="action" value="process"><table border="0" width="100%" cellspacing="0" cellpadding="0">

      <tr>

 

so I see that the form is starting, and here

 

</tr>

    </table></form></td>

<!-- body_text_eof //-->

    <td width="125" valign="top"><table border="0" width="125" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

 

so I see the form is closing in the block.

 

Now, onto what STS is translating that block into in $content.

 

We look for the block labeled $template['content']:

 

<!-- start content //-->

<form name="create_account" action="http://www.tearetreat.com/catalog/create_account.php" method="post" onSubmit="return check_form(create_account);"><input type="hidden" name="action" value="process"><table border="0" width="100%" cellspacing="0" cellpadding="0">

      <tr>

        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

          <tr>

            <td class="pageHeading">My Account Information</td>

 

There's our <form> start tag, lets check and see if it has the closing tag

 

</tr>

            </table></td>

          </tr>

        </table></td>

      </tr>

    </table></form>

<!-- end content //-->

 

Yep, looks like we've got the <form> closing tag, too. So, it looks like so far everything is working correctly.

 

Let's see what else could be the problem...

 

Okay, I see

onSubmit="return check_form(create_account);
in your <form> open tag, lets see if the javascript function check_form() is making it into the template.

 

The easiest way to do this is to just view the HTML source of the page rendered by STS (without the debugging).

 

Since you have debugging turned on, I'll force it off by calling your page with sts_debug=0 in the URL like this:

 

http://www.tearetreat.com/catalog/create_a...php?sts_debug=0

 

I look at the "View HTML Source" and see that the functions are there. Okay, that seems okay.

 

Run a test form, get the error messages you described.

 

Unfortunately, everything looks correct as far as STS goes. Without being able to debug on the machine, I can't really tell you more than that.

 

I know that the default STS configuration works correctly with the default create_account.php script, so maybe there's a problem somewhere in the customizations?

 

Sorry I'm not more help...

 

No news is bad news,

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Thanks for your through help. Maybe this can shed some light. When I first modified my site using STS, I merely changed the sts_template.html file in Dreamweaver for the design I wanted. Using this I was able to log on and create and account. Then, I created my own html design in a new document, renamed the file sts_template.html, cross referenced everything as best I could and since then it hasn't let me create an account.

 

FYI, I've also just add the PWA contribution and it seems to be working fine with STS, but no help on the account creation, it still does the same. Thanks again for any time you can invest on helping :)

Link to comment
Share on other sites

Hi. I'm posting this for second time... Can somebody please check this out ? thank you.

 

Hi.

 

I removed the category text ("let?s see what we have here") and changed it to an image (500*40 pixels). How do I center this image (it is aligned to the right) ?

 

thank you.

shutiri.

Link to comment
Share on other sites

Hi. I'm posting this for second time... Can somebody please check this out ? thank you.

 

Hi.

 

I removed the category text ("let?s see what we have here") and changed it to an image (500*40 pixels). How do I center this image (it is aligned to the right) ?

 

thank you.

shutiri.

don't know what this has to do with sts but:

 

go to your index.php and look for:

 

  } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {

 

and beneath that find:

 

            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

and there change to that:

 

            <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>

 

;)

Link to comment
Share on other sites

I worked around with the "coolmenu" distribution and still couldn't figure out, why it is not working...

 

 

...the coolmenu distrib works with a nice JS from:

 

http://www.dhtmlcentral.com/projects/coolmenus/

 

this script is very very easy to customize...

 

 

so what the distrib does is, that it builds the menu-content from the the categories database content - same as the normal categories script does - with the only difference that it puts javascript around everything - still shouldn't make a difference

 

when i install the coolmenu it even displays a box and a box header which says "categories" - but somehow there is no content in that box - no menu

 

maybe there is a problem with the JS code with STS?

 

does sts have a problem with JS in the body?

 

 

I hope j0ker can show me what he means soon! :o

 

 

I really need to get this working, because the menu is blowing up my column left at the moment...

 

@brian - I even think you should take a look at that contrib, because it would be a great addition to your contrib and I think it would benefit a lot from that! ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...