Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

I appologize in advance for being a newbie, but I gotta start somewhere.

 

OK, I've searched thru the forum for 2 days looking for an answer to my problem. I am using the latest version of OSC and recently installed STS. I have zero knowledge of PHP or OSC for all it matters and am trying to add a search field to the table that the breadcrumbs reside. I don't want the search box there which is what people have told me in the past to do. The following is the code that I have attempted to add to sts_user_code.php:

 

    $sts_block_name = 'searchbar';
   require(STS_START_CAPTURE);
//  require(DIR_WS_BOXES . 'search_bar.php');
   echo "\n<tr class="header">\n";
   echo "<td valign="middle" align="right">\n" 
   echo "Search: ";
   echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'). tep_draw_input_field('keywords','','size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES))));
   echo "</td>\n";
   echo "<td valign="middle" width="30" align="center">\n";
   echo "<input type="image" src="images/index/go_off.gif" border="0" alt="Quick Find" title=" Quick Find ">\n";
   echo "</form>\n";
   echo "</td>\n";
   echo "</tr>\n";
   require(STS_STOP_CAPTURE);
   $template['searchbar'] = strip_unwanted_tags($sts_block['searchbar'], 'searchbar');

 

I'd be soooo greatful if someone can beat me over the head first and then if they may be so inclined please point me in the right direction so that I may find a solution to this dilemma. If this requires that I pay someone for the bit of advice I might just have to take a look into my PayPal account and see if I got a few bucks.

 

To get an idea of what I'm trying to do please look at my website www.electronicswarehouse.net/catalog. I accomplished this by removing all the html stuff from the code above and only left the block code and the tep_draw_form code. Of course this doesn't work though:

 

    $sts_block_name = 'searchbar';
   require(STS_START_CAPTURE);
   echo "Search: ";
   echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'). tep_draw_input_field('keywords','','size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES))));
   require(STS_STOP_CAPTURE);
   $template['searchbar'] = strip_unwanted_tags($sts_block['searchbar'], 'searchbar');

 

-James Burkart

[email protected]

http://www.electronicswarehouse.net/catalog

Link to comment
Share on other sites

I have just come across the STS contribution and this should be perfect for me to design my site.

 

However, I have just installed it and there is a problem without any changes yet.

 

It seems like my left and right columns are included in $content. STS is new to me, so I am not quite sure how to pinpoint the problem.

 

Here is what happens:

 

If I just use the template that comes with STS, the tables are all out of whack because $content basically contains everything between the header and the footer.

 

If I delete out the $content from the template, the page looks okay (the tables are fixed), but the boxes don't show up even though the tags are in the template!

 

This has me scratching my head. I tried searching through the forums, but couldn't find what I was looking for. Can anyone help?

 

Thanks!

 

Here is the site http://www.acehighsupply.com

Link to comment
Share on other sites

To add:

 

Right now, I have the normal viewing mode on because I have a few people looking at the site.

 

If you look at the debug (http://acehighsupply.com/index.php?&sts_debug=1) - the $template['content'] includes the body text and left&right columns. Shouldn't it just include from <!-- body_text //--> to <!-- body_text_eof //-->?

 

As I mentioned, I am not sure where STS is pulling the information for $content, so I am not sure what I need to change. I have uploaded a fresh index.php, but that changed little.

 

Thanks for any help!!

Link to comment
Share on other sites

Adding more to define the problem:

 

If I just use the template that comes with STS, the tables are all out of whack because $content basically contains everything between the header and the footer.

 

If I delete out the $content from the template, the page looks okay (the tables are fixed), but the boxes in the left and right columns don't show up (except for the reviews in the right - the only thing in the left is the drop down category box) even though the tags are in the template!

 

If I just put $content in the body of the STS template HTML (nothing else in the body), the entire left and right columns show, along with the middle content. It is as if you just cut off the top and bottom portions of the website.

Link to comment
Share on other sites

I currently have the default template page (the page included with this contribution) loaded on the server.

 

You can test it here: http://acehighsupply.com/index.php?&sts_template=1

 

As you can see, the header, body, footer, and both columns have been added to the end of the output from STS. However, the content and boxes in the columns are not in the output from STS.

 

If I just put a blank HTML file for the template (nothing in the body), the header, footer, body, and columns are there - it looks like the normal page.

 

 

This has me VERY confused. Anyone have any suggestions?

 

Thanks!

Link to comment
Share on other sites

Am having brain freeze..... :(

 

If I use a separate html file with STS as my home page and have a link to the catalog for shoppping:

 

What file must I include in my home page html file to get the session id to pass back and forth if the user clicks on 'home' link ?

 

See.... told you I had brain freeze.

 

The production site is at Best From USA

 

Thank you for any assistance!

 

Best,

 

Dave

Link to comment
Share on other sites

Am having brain freeze.....  :(

 

If I use a separate html file with STS as my home page and have a link to the catalog for shoppping:

 

What file must I include in my home page html file to get the session id to pass back and forth if the user clicks on 'home' link ?

 

See.... told you I had brain freeze.

 

The production site is at Best From USA

 

Thank you for any assistance!

 

Best,

 

Dave

You simply change your OSC install from /catalog/ or whatever to be in your web site's main directory.

 

Instead of starting with /catalog/index.php you would just use /index.php and have your main category template page with whatever you want for your site's home page.

 

This help at all?

 

- Brian

Edited by DiamondSea

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 maybe someone already posted this kind of question but here goes,

 

I made a nice webshop template that I wish to use and I installed STS 2.01 and I don't get any errors, but I have buttons that I want to use for the cart categories etc.. but i can't seem to get it to work I know how to link in HTML but it doesn't seem to work if I use $cartcontents or $urlcartcontents. I just get the text.

 

So if you could help me on my way I will be a happy man again.

 

 

Greetz Iwan

Link to comment
Share on other sites

Brian-

 

I want to have my home page in the /best directory, and then when you click on a category or shopping it goes over to the /best/catalog. So I am not using index.php until they click on something.

 

Do I need to use index.php.html as my home page???

 

I need some sleep!! lol

 

Thanks Brian.

Link to comment
Share on other sites

Brian -

 

Thought of a better way to phrase my question.

 

If I have a home page outside of the oscommerce site with a shopping link, how do I get it to pass the session variable if a user goes from the shop to the original home page and back?

Link to comment
Share on other sites

I currently have the default template page (the page included with this contribution) loaded on the server. 

 

You can test it here:  http://acehighsupply.com/index.php?&sts_template=1

 

As you can see, the header, body, footer, and both columns have been added to the end of the output from STS.  However, the content and boxes in the columns are not in the output from STS. 

 

If I just put a blank HTML file for the template (nothing in the body), the header, footer, body, and columns are there - it looks like the normal page.

 

 

This has me VERY confused.  Anyone have any suggestions?

 

Thanks!

Anyone have a clue what could be wrong with my site? Any suggestions to fix it? I really want to start working on the design, but with this problem I am completely stuck and can't do anything. Any help would be much appreciated!! :D

 

I made a few posts describing the problem - it is more than what is quoted here.

Edited by SirPsycho
Link to comment
Share on other sites

hows the new site coming along Daniel, liked the old one quite a lot and was wondering if you have moved along with the new design at all.

Link to comment
Share on other sites

Hi I figured out how to add the tags and how to link with the buttons,

 

But I am using the $content tag and it works fine but now I need to edi the content of course but where do I do that.

 

 

Please help

 

:(

 

Thank you in advance

Link to comment
Share on other sites

I am having trouble using STS for a catagory template. I have made a template for my main catalog page and it works fine; however, when I make a template for a category it does not work properly. In the readme there are conflicting statements. One says to call the category template "index.php.html" while another portion says to call it "product_info.php.html". When I call it product_info.php.html the category page uses the default template; however, when I call it index.php.html the category page uses that template but the variable names such as $productname are displayed not the actual product name.

 

What am I doing wrong?

Link to comment
Share on other sites

Question regarding an apparent incompatibility between STS and Automated Auction Process contribs.

 

When I'd create an auction listing with AAP it would display fine from the osc preview screen but when I inserted the generated code into an ebay auction description my website appears with the listing description in the center, appearing the same as if the listing were navigated to through my website alone. Basically my entire website runs inside the ebay description.

 

Removed STS and Automated Auction Process works and displays fine. Unfortunately, I don't have the aptitude to troubleshoot any further. I posted to the AAP thread but haven't received any suggestions yet so I'm trying here.

 

Has anyone configured OSC to run both STS and Automated Auction Process or know what I need to change to get them to play nicely with each other?

Link to comment
Share on other sites

Hi

 

I want to be able to do something like this image, I have the contribs which give me th inc/exc vat, stock available, desciptions, and so on but I am at a loss how to go any further.

 

products.gif

 

Would I need to use templates, or can I just mod existing files to give me this solution?

 

Plz any pointers will be usefull. :D

Link to comment
Share on other sites

Hello. First of all, thanks for designing this system. I am enjoying using it.

 

However I have hit a hurdle. It seems that the product_info.php templates are not being "seen" by the system. I am not sure if the problem resides in my STS configuration, or my osCommerce configuration. I am only using the easypopulate and STS contributions to date, and only added easypopulate today, whereas I have been having the product_info problem since day 1.

 

I started with a clean osCommerce install and then added in STS. Built a sts_template which is working swell. However, I cannot get product_info.php.html-sample file to work nor a modified file of my own. I have renamed the file I want to use to "product_info.php.html" and it resides in /catalog/includes/sts_templates.

 

Any suggestions on things to check? Even stupid things, although I have checked my spelling, etc.

 

The site can be seen at www.atrracewear.com/catalog and what you will see is using the sts_template.html only. I want to further tweak the product display (for example move the price location). I know some of this can be done in the main php but that defeats the point of sts, eh?

 

Thanks in advance for any suggestions or responses.

Link to comment
Share on other sites

I see the page and products and name of the products but price is zero, so what is the problem?

Price is zero as client has not given me the prices yet.

 

What you are seeing is the page based upon the sts_template, using the $content variable in the main box. Here's what it looks like: http://www.atrracewear.com/catalog/include...s_template.html

 

I want to alter $content, basically. The normal way is to go directly in the osCommerce version of product_info.php and rework the PHP there. I would rather not do that, for the reasons of I am not very good with PHP and that would break upward migration of osCommerce.

 

My understanding is that in using STS, one can create a product_info.php.html file and place it in catalog/includes/sts_templates, through which one can alter the output of the $content variable (apparently STS takes the output of product_info.php and reformats it).

 

My problem is that either STS or osCommerce are not seeing my product_info.php.html file.

Whether I use the sample as provided with STS or my own, neither is being used.

 

If you look at http://www.atrracewear.com/catalog/include...t_info.php.html, you'll see the default template I am trying to implement.

 

My desired template is at: http://www.atrracewear.com/catalog/include...fo.php-atr.html (obviously it needs some tweaking, but I want to get it running first!)

 

I think I simply have some sort of basic configuration error going on, or something is in the wrong place, wrong permissions, etc.

Link to comment
Share on other sites

Hello,

 

What am I doing wrong?

 

Everything else is fine except my product_info pages which are all screwed up. Take a look.

 

I don't want to bother with the product_info templates because I have too many contribs (Ultra pics, Master Prods etc) that will probably not be outputted.

 

Anyone see what is wrong?

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...