Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Basic Template Structure v1.0 - For MS2


Brenden

Recommended Posts

  • Replies 217
  • Created
  • Last Reply

Top Posters In This Topic

in filenames.php I have the lines:

  define('CONTENT_PRODUCTS_NEW', 'products_new');

  define('FILENAME_PRODUCTS_NEW', CONTENT_PRODUCTS_NEW . '.php');

 

In "catalog/templates/content" there is a file called "products_new.tpl.php"

 

But any changes made to "products_new.tpl.php" don't have any effect on the new product page look. If i rename this files I should get an error message, but that also does not happen. :(

 

As far as I know, all other templates work as they should.

 

Any ideas anyone?

Link to comment
Share on other sites

Hi,

 

For anyone interested here is some suggestions to modify BTS further. I think it is a really great contribution. I have got it working with quite a few mods now including articles. I don't have much time to support this. This is not perfect as I am sure there will be a few areas that I have not mentioned, but It will be enough for someone who is ok with PHP and to make modifications to file links etc within php calls. I am new to PHP so maybe others have suggestions to improve this further, but I hope it can add value to some users and make it into the official mod.

 

I have adjusted the configure.php to include three new settings.

 

Set a design theme folder

define('DIR_WS_TEMPLATE_THEME', 'mynewdesign/');

 

So I can have multiple design folders

define('DIR_WS_TEMPLATES', 'templates/' . DIR_WS_TEMPLATE_THEME);

 

So I can set the name of the stylesheet to easily switch it out.

define('TEMPLATENAME_STYLESHEET', 'stylesheet.css');

 

 

This will allow for multiple template folders that you can design sites with and easily switch them

 

In these folders below goes the box.tpl.php

content folder

main_page.tpl.php

poup.tpl.php etc

 

So you can end up having multiple designs and switch them in the configure. It would be nice if this could be admin controlled to switch them.

 

catalog/templates/oscommerce/

catalog/templates/customdesign1/

catalog/templates/customdesign2/

 

I have also done things like include folders for holding template images

 

catalog/templates/oscommerce/images/default_icons/ - eg icons featured in boxes

catalog/templates/oscommerce/images/infobox/ - eg corner gifs

catalog/templates/oscommerce/images/page_icons/ - the little illustrations for each section

 

In the template pages to use some of this I'll give you an example.

 

In the page template files set the stylesheet link.

 

<link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_TEMPLATES . TEMPLATENAME_STYLESHEET; ?>">

 

And links to some of the image now in the template folders

 

<?php echo tep_image(DIR_WS_TEMPLATES . 'images/' . 'page_icons/' . 'table_background_login.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>

 

There will be some other files that will need references adjusted to point to the templates folder but now it makes it easier to duplicate a whole template design folder and to have different stylesheets/icons etc.

 

Cheers,

James

Link to comment
Share on other sites

I don't understand how to create a template for the "new products" page.

Finally I discovered that I was looking in the wrong direction. <_<

 

There is a:

catalog/products_new.php

page which shows new products, there is a BTS template for this file: catalog/templates/content/products_new.tpl.php

 

and there is a module:

catalog/includes/modules/new_products.php

it shows the new products for the month in a box below the "content box" on several pages, there is no BTS template for this file yet

(but not to difficult to make one probably)

 

Pfft..

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I am using BTS in a MS2.2 store and love it! I do have a question regarding meta_tags.php

 

Whenever the index.php page is viewed the Title in the browser reads NAVBAR_TITLE

 

All other pages diplay the correct title...if you like you can see it in action here:

 

http://dolphininc.net/onlinestore

 

I have tried to fiddle with the script but can only succeed in breaking it.

How can I get it to output anything else?

 

I also have a store that I heavily customized before discovering BTS and was

curious if I can use only the meta_tags.php as a stand alone script.

 

Any help is greatly appreciated.

 

TIA!

 

Pete Zeiner

Link to comment
Share on other sites

Hello,

i have a problem.

 

Fatal error: Failed opening required 'DIR_WS_INCLUDESmeta_tags.php' (include_path='.:/usr/local/lib/php') in /homepages/30/d78512637/htdocs/b2c/catalog/templates/main_page.tpl.php on line 5

 

the meta_tags.php file is in the there but why Fatal Error?

 

Thank you for the comments :D

Link to comment
Share on other sites

I keep getting this error after installing the contriution and the patch:

 

 

 

Warning: mysql_connect(): Access denied for user: 'nobody@localhost' (Using password: NO) in /home/mdmurphy95/www/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

Link to comment
Share on other sites

Fatal error: Failed opening required 'DIR_WS_INCLUDESmeta_tags.php' (include_path='.:/usr/local/lib/php') in /homepages/30/d78512637/htdocs/b2c/catalog/templates/main_page.tpl.php on line 5

 

the meta_tags.php file is in the there but why Fatal Error?

I think your DIR_WS_INCLUDES is not defined.

 

catalog/includes/configure.php should contain the line:

define('DIR_WS_INCLUDES', 'includes/');

approx at line 25

 

If it isn't defined your "templates/main_page.tpl.php" tries to load "metatags.php" from "DIR_WS_INCLUDES", after it is defined "DIR_WS_INCLUDES" will have the value "includes/".

 

Paul

Link to comment
Share on other sites

Hi I am trying to delete obsolete tables from osC using the BTS.

 

I already have done:

-main_page.tpl.php

-box.tpl.php

-content/index_default.tpl.php

-content/index_products.tpl.php

 

working on:

-content/product_info.tpl.php

 

I discovered that it is more work than I thought :( , is there anyone who wants to help? Or anyone who has already done (some of) the pages below and wants to share.

 

(in catalog/templates/content)

26-09-2003  11:21                99 popup_image.tpl.php
26-09-2003  11:21             1.145 popup_search_help.tpl.php
26-09-2003  13:56             3.024 password_forgotten.tpl.php
26-09-2003  13:56             1.687 static.tpl.php
26-09-2003  13:56             1.374 ssl_check.tpl.php
26-09-2003  13:56             3.871 specials.tpl.php
26-09-2003  13:56             9.769 shopping_cart.tpl.php
26-09-2003  13:56             5.682 reviews.tpl.php
26-09-2003  13:56             5.098 products_new.tpl.php
26-09-2003  13:56             1.697 logoff.tpl.php
26-09-2003  13:56             5.569 login.tpl.php
26-09-2003  13:56             1.691 create_account_success.tpl.php
26-09-2003  13:56            11.988 create_account.tpl.php
26-09-2003  13:56             1.895 cookie_usage.tpl.php
26-09-2003  13:56             3.955 contact_us.tpl.php
26-09-2003  13:56             3.433 checkout_success.tpl.php
26-09-2003  13:56            11.534 checkout_shipping_address.tpl.php
26-09-2003  13:57            12.320 checkout_shipping.tpl.php
26-09-2003  13:57            11.960 checkout_payment_address.tpl.php
26-09-2003  13:57            12.358 checkout_payment.tpl.php
26-09-2003  13:57            11.701 checkout_confirmation.tpl.php
26-09-2003  13:57             6.726 address_book.tpl.php
26-09-2003  13:57             4.163 account_password.tpl.php
26-09-2003  13:57             6.501 account_notifications.tpl.php
26-09-2003  13:57             3.550 account_newsletters.tpl.php
26-09-2003  13:57             8.758 account_history_info.tpl.php
26-09-2003  13:57             5.458 account_history.tpl.php
26-09-2003  13:57             5.915 account_edit.tpl.php
26-09-2003  14:09             5.252 product_reviews_write.tpl.php
26-09-2003  14:09             4.972 product_reviews_info.tpl.php
26-09-2003  14:09             7.738 product_reviews.tpl.php
26-09-2003  14:09             5.109 index_nested.tpl.php
26-09-2003  14:09             9.341 advanced_search_result.tpl.php
26-09-2003  14:09             5.860 advanced_search.tpl.php
26-09-2003  14:09             6.450 address_book_process.tpl.php
26-09-2003  14:09             5.127 tell_a_friend.tpl.php
26-09-2003  14:13             9.246 account.tpl.php

Link to comment
Share on other sites

I'm using Basic Template Structure v1.0a, when entering address_book_process.php

i recieve the following error:

 

Fatal error: Failed opening required 'includes/javascript/address_book_process.js.php' (include_path='.:/usr/local/lib/php') templates/main_page.tpl.php on line 11

 

does Basic Template Structure v1.0a have a bug or am i doing something wrong??

 

thanx.

mike

Link to comment
Share on other sites

hi mike,

 

very very strange, I never noticed this error until a few minutes after reading your post!

I decided to give it a look and before I got where I wanted exactly the same error popped up???!

 

I noticed that the file:

"includes/javascript/address_book_process.php"

does exist

 

if I rename it to:

"includes/javascript/address_book_process.js.php"

 

I don't get the error, but I am note sure if this is the right solution.

 

Paul

Link to comment
Share on other sites

I'm trying to apply BTS to a contribution (printable catalog) that I added after installing BTS.

 

I've got it nearly right but I can't get the bottom banner (the one with date and number of page views) to extend across the page. It starts in line with the start of the content of the printable catalog part of the page - that is the area under column left is blank. I've tried amending the table settings, which I reckon is the solution but cant get it right.

 

The page has column left, then the printable catalog content, then column right. The banner only appears under the last 2 parts of the page.

 

I've tried looking at the way other pages use main_page.tpl and can't see anything wrong.

 

The relevant bit of code is:

 

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top">
   <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
         <!-- left_navigation //-->
         <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
         <!-- left_navigation_eof //-->
      </table></td>
      <!-- content //-->
   <td width="100%"valign="top">
      <?php
         if (isset($content_template)) {
            require(DIR_WS_CONTENT . $content_template);} 
   else {
              require(DIR_WS_CONTENT . $content . '.tpl.php');
            }
      ?>
   </td>
   <!-- content_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top">
   <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
         <!-- right_navigation //-->
         <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
         <!-- right_navigation_eof //-->
      </table></td>
   </tr>
</table>
<!-- body_eof //-->

 

and below that I have the following:

<!-- footer //-->
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
   <td class="footer">  Sunday 05 October, 2003  </td>

   <!--<td align="right" class="footer">  2726 requests since Thursday 17 July, 2003  </td>-->
   <td align="right" class="headerNavigation"><a href="http://mystore.com/ship.php"class="headerNavigation">Delivery</a> | 
                                           <a href="http://www.mystore.com/shipping.php"class="headerNavigation">Shipping</a> | 
             <a href="http://www.mystore.com/privacy.php"class="headerNavigation">Privacy</a> | 
             <a href="http://www.mystore.com/conditions.php"class="headerNavigation">Conditions</a> | 

             <a href="http://www.mystore.com/contact_us.php"class="headerNavigation">Contact</a> | 
             <a href="http://www.mystore.com/gv_faq.php"class="headerNavigation">Gift Voucher FAQ</a> | 
             <a href="http://www.mystore.com/catalog_products_with_images.php"class="headerNavigation">Printable Catalog</a> |  </a><br>
  </td>  
 </tr>
</table>

 

Any ideas would be much appreciated

Link to comment
Share on other sites

Hi Paul

 

Thanks for the reply. I solved the problem. What I overlooked was that when I created the .tpl file I didn't remove the start and end HTML tags. When I embedded this the source HTML had 2 sets of start and end tags which confused it (and me)

 

A bit more tinkering and it was sorted. Think I should be ok now adding new contributions to the BTS

 

thanks again

Link to comment
Share on other sites

Hallo,

Can I install the basic Template stucture v1.0b. on a osC2.2 + wysiwyg HTMLAerea v1.7 + Simple Template System 1.7. ???

Greetings Floortje :rolleyes:

Link to comment
Share on other sites

Hi All!

 

First, many thanks to Brenden for this great contribution.

 

I have a problem, though, and I' m surprised I haven't found anything in the posts.

 

The pb is with the error messages in create_account.php and account_edit.php.

If I'm not getting nuts, in the "regular" MS2 2.2 the error messages displayed when a field is filled improperly or not at all, appear in a javascript pop-up, right?

 

After having added the BTS, they are displayed on the page itself, be it create_account.php or account_edit.php. Well, I don't care about that, but the messages only say, for example :

 

[warning icon] 6 chars minimum or

* (and nothing else).

 

Does anybody know how I can fix that, what files are concerned, or tell me if while struggling a bit with various issues, I happened to mix different versions of OSC...

 

Thanks in advance for your help!

 

Cesco

Link to comment
Share on other sites

Solved...

 

My misery has nothing to do with STS: I've put a terrible mess in my french files, trying to keep as much as possible of what I had done with previous releases to fit my needs and taste....

The site I'm working on being franco-french, I got rid of all the other languages...

So it took me time to realize that the pb was only related to that...

 

If all the mistakes have done can help others...they'll get rich!

 

Cesco

Link to comment
Share on other sites

Hoi Floortje,

 

Can I install the basic Template stucture v1.0b. on a osC2.2 + wysiwyg HTMLAerea v1.7 + Simple Template System 1.7.

The Basic Template Stucture and the Simple Template System, seems like overkill to me. Do you really want both?

 

PaulM

Edited by paulm2003
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...