Jump to content
Latest News: (loading..)
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I'm having trouble with the blueshop tutorial. I hit a snag programming

BOX_HEADING_SHOPPING_CART.

 

I have included the new code in sts_user_code.php and received the following error:

 

"Parse error: parse error, unexpected T_STRING in /.../oscommerce/catalog/includes/modules/sts_inc/sts_user_code.php on line 51"

 

My debugger list line 51 as:

 

tep_href_link(FILENAME_CHECKOUT_SHIPPING, ", 'SSL') . ' class="headerNavigation">' .

 

This looks like a syntax error, but I can't figure it out!

 

What does your experience say...

 

/r

 

 

http://www.oscbooks.com/support.php

Share this post


Link to post
Share on other sites
Note to admin: Please enable Edit posts.

 

 

Let me restate the above problem.

 

The script will run if I comment out

 

if ($cart->count_contents() > 0) {

/*

$sts->template['shoppingcartarea'] .= '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . '

class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a> · <a href=' .

tep_href_link(FILENAME_CHECKOUT_SHIPPING, ", 'SSL') . ' class="headerNavigation">' .

HEADER_TITLE_CHECKOUT . '</a>';

*/

}

 

The source is taken from page 24 of the eBook "Design an osCommerce Super Site using STS.

 

I am new to php so am learning it during this project - slow going. I'll solve this by taking the script apart piece by piece; I was hoping for some insight to expediate the process. The character string seems to be right - I may have misinterpreted something... But I probably have the spacing wrong...

 

 

http://www.oscbooks.com/support.php

Share this post


Link to post
Share on other sites
I apologize for posting so many times in a row...

 

 

tep_href_link(FILENAME_CHECKOUT_SHIPPING, ", 'SSL') is the culprit. On my editor two single quotes are spaced MUCH farther apart than they appear in the manual.

 

So... '' is two single quotes NOT one double quote. I should seen through this problem immediately... DUMB.

 

 

http://www.oscbooks.com/support.php

Share this post


Link to post
Share on other sites
I would like to install an ssl and dedicated ip on my server. I know that the STS didnt work with SEO URLS in the default admin. Will this be a problem. what links will I have to change, where do I change them in the admin. Is there a way to tell the system to use https: ? thanks

David,

 

First off, STS works with SEO URLS.

 

Second, STS does not care if you are using an SSL certificate or not.

 

You will need to setup up osCommerce correctly to use a SSL certificate. The settings will need to be changed in two files: admin/includes/configure.php and includes/configure.php


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

After installing sts 4.5 i get LOADS of errors like - logger.php error

and stuff like that. I did manual installation and everythings in the right area, what went wrong???

Share this post


Link to post
Share on other sites
After installing sts 4.5 i get LOADS of errors like - logger.php error

and stuff like that. I did manual installation and everythings in the right area, what went wrong???

 

Jacob,

 

Did you do a file comparison to be sure you have all of the code changes & additions in the correct locations?


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

I'm looking for

 definition of $content (Burton's STS tutorial).

If I say it's safe to surf this beach Captain ......

Then it's safe to surf this beach!

Share this post


Link to post
Share on other sites
I'm looking for
 definition of $content (Burton's STS tutorial).

Rob,

 

The tutorial is using STSv4.5.8 so the $content tag is the same.

 

$content is taken from the php script you are running. For example, the $content for index.php is the piece of code you find in index.php, between the call of column_left and the call of column_right. If you want to modify it, you have to modify the script itself.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi,

 

I have installed the latest STS module + RC2a

 

When I implement the "terms and conditions agreement" contribution it doens' t seem to work? (www.oscommerce.com/community/contributions,219)

I can see the checkbox, but it doesn't give a warning when I leave it emty.

Has this something to do with the javascript? I allready tryed to place the javascript in de template.. but still the same..

 

Can someone help me out?

 

Regards,

Dirk

Share this post


Link to post
Share on other sites
The tutorial is using STSv4.5.8 so the $content tag is the same.

More specifically then: When you first startup the cart, you have a right and left column plus the main content down the center. The center column starts out of the box with information on how to modify the intro text. That's in the English folder. But above the text that can be modified is a header that can give the user's name if logged in or invites the user to login or register. What is that and where is it found? I'd like to push that around a bit.

 

$content is taken from the php script you are running. For example, the $content for index.php is the piece of code you find in index.php, between the call of column_left and the call of column_right. If you want to modify it, you have to modify the script itself.

If I understand the above description correctly, $content is pre-processor that every page call passes through so as to have the parts end up in the right place...?

 

What/where is the processor that does that? Just curious...

 

How do I learn how to decipher where things are coming from. A user turned me on to

 

http://www.oscdox.com/crossx/nav.html?_functions/index.html

 

Very cool and necessary... But I'm still a bit lost!

 

Thank you for helping me :D


If I say it's safe to surf this beach Captain ......

Then it's safe to surf this beach!

Share this post


Link to post
Share on other sites

 

More specifically then: When you first startup the cart, you have a right and left column plus the main content down the center. The center column starts out of the box with information on how to modify the intro text. That's in the English folder. But above the text that can be modified is a header that can give the user's name if logged in or invites the user to login or register. What is that and where is it found? I'd like to push that around a bit.

Look in the STS User Manual in section 4. $myaccountlogoff

 

How do I learn how to decipher where things are coming from. A user turned me on to

 

http://www.oscdox.com/crossx/nav.html?_functions/index.html

 

Very cool and necessary... But I'm still a bit lost!

 

Take a look at the 'doc' folder from the STS contribution. Inside this folder you will see how STS picks the template to use, and the use of the STS tags.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

can anyone tell me how to get this to work? should be simple:

?>
$sts->start_capture();
$page_query = tep_db_query("select 
							   p.pages_id, 
							   p.sort_order,
							   p.status,
							   s.pages_title,
							   s.pages_html_text,
							   s.intorext,
							   s.externallink,
							   s.link_target  
							from 
							   " . TABLE_PAGES . " p LEFT JOIN " .TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id
							where 
							   p.pages_id = 8 
							and 
							   p.page_type != 1 
							and 
							   s.language_id = '" . (int)$languages_id . "'
							order by 
							   p.sort_order, s.pages_title");
$page = tep_db_fetch_array($page_query);
echo'<a target="'.$target.'" href="' . $page['externallink'] . '">' . $page['pages_title'] . '</a>';
echo'<a target="'.$target.'" href="' . tep_href_link(FILENAME_PAGES, 'pages_id=' .$page['pages_id'], 'NONSSL') . '">' . $page['pages_title'] . '</a>';
$sts->stop_capture('aboutusp');
?>

all I want is for it to take the page id and the title of the page in the correct language. I'll create a new entry for each of the extra info pages.

Share this post


Link to post
Share on other sites
can anyone tell me how to get this to work? should be simple:

?>
$sts->start_capture();
$page_query = tep_db_query("select 
							   p.pages_id, 
							   p.sort_order,
							   p.status,
							   s.pages_title,
							   s.pages_html_text,
							   s.intorext,
							   s.externallink,
							   s.link_target  
							from 
							   " . TABLE_PAGES . " p LEFT JOIN " .TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id
							where 
							   p.pages_id = 8 
							and 
							   p.page_type != 1 
							and 
							   s.language_id = '" . (int)$languages_id . "'
							order by 
							   p.sort_order, s.pages_title");
$page = tep_db_fetch_array($page_query);
echo'<a target="'.$target.'" href="' . $page['externallink'] . '">' . $page['pages_title'] . '</a>';
echo'<a target="'.$target.'" href="' . tep_href_link(FILENAME_PAGES, 'pages_id=' .$page['pages_id'], 'NONSSL') . '">' . $page['pages_title'] . '</a>';
$sts->stop_capture('aboutusp');
?>

all I want is for it to take the page id and the title of the page in the correct language. I'll create a new entry for each of the extra info pages.

Peter, are you simpy wanting to create a link to a page that was created using the Page Editor contribution and have that page be called up in the current selected language?

 

If so, then you could simply create a text link in your template page as the following:

 

<a href="pages.php?page=about_us">


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

how can i get the html code for $categorybox, $languagebox, $currenciesbox and $cartbox? it's very very urgent and i'm newbbie in this project.

Edited by SmileX

Share this post


Link to post
Share on other sites

can't edit last post

 

i want to know how can i modify (class,color,size) the title of $categorybox and the other section that i wrote in my last post.

Share this post


Link to post
Share on other sites
can't edit last post

 

i want to know how can i modify (class,color,size) the title of $categorybox and the other section that i wrote in my last post.

 

  1. Use the Infobox Template feature in STS
  2. Edit the stylesheet.css file or add the CSS code directly in your infobox template


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Thanks, but in infobox i can modify only one header that represents all headers of that boxes...

i want to change this:

28jvgq1.jpg

into this:

16gctqa.jpg

 

I want to modify each one headers... not one header that represent all headers...

 

Can you help me, please?

Share this post


Link to post
Share on other sites
Thanks, but in infobox i can modify only one header that represents all headers of that boxes...

 

I want to modify each one headers... not one header that represent all headers...

 

Can you help me, please?

 

Not true. You are not understanding how the Infobox Template feature works. You can have specific infobox template for each box and a general infobox template that will be used for all infoboxes that do not have a specific infobox template created.

 

The infobox template themselves can be divided into two separate templates; a header template and a content template.

 

Please consult the STS User Manual for the details on the infobox templates.

Also read the following links to gain a better understanding of how it works:

 

Hope this helped you out,


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Thank you very much for that advices! You don't know how much i appreciate them :D

I solved my latest problem but I'm still trying to get the template working and i'm still having problems...

I read the links quickly but i still don't know how can I modify the main content of the site... (Content of middle column in index)

In sts_template.html on middle column i have only $content.. not the $content detailed..

I want to delete the welcome message and put the latest products added in middle-top.

What should i do in this case? Thanks in advance.

Share this post


Link to post
Share on other sites

*later post

i want to mention that i know about the sts_templates/full/content ... but there is only the file "product_info.php_26.html".. i need one like index.php.html or index_content.php.html.. i don't know exactly.. i explained in my last post what i want to do..

Share this post


Link to post
Share on other sites

I apologise for my triple post... don't consider this spam please.

 

I want to be more exactly and i decided to take some printscreens:

I want to change this:

3518sae.jpg

(from index content)

 

and this:

11i2yw6.jpg

(from specials)

 

into this:

4ktis8.jpg

and this:

2luxt6p.jpg

 

I made an infobox_specials.php.html, but with this solution i haven't got any detailed $content... because, for example, in infobox_specials.php.html i have only $headertext and $content.. and i can't see $content in details.. for example i want to modify the size and color for the price, to put a button like "add to cart"etc. and i don't know how to manipulate this...

With the css style it's no problem.. i can solve this without problems... problems i have i finding that detailed $content for index and specials.

Can you help me?

 

ps. read pls my second and third post on page 226.

Edited by SmileX

Share this post


Link to post
Share on other sites
I apologise for my triple post... don't consider this spam please.

 

I want to be more exactly and i decided to take some printscreens:

I want to change this:

3518sae.jpg

(from index content)

 

and this:

11i2yw6.jpg

(from specials)

 

into this:

4ktis8.jpg

and this:

2luxt6p.jpg

 

I made an infobox_specials.php.html, but with this solution i haven't got any detailed $content... because, for example, in infobox_specials.php.html i have only $headertext and $content.. and i can't see $content in details.. for example i want to modify the size and color for the price, to put a button like "add to cart"etc. and i don't know how to manipulate this...

With the css style it's no problem.. i can solve this without problems... problems i have i finding that detailed $content for index and specials.

Can you help me?

 

ps. read pls my second and third post on page 226.

 

  1. You need to install the Featured Products contribution.
  2. Edit your stylesheet to modifiy the styles and colors or add the styles directly to the specials box template.
  3. The middle part of your site is being pulled in by the $content tag. The $content tag pulls in exactly what is listed from the actual PHP pages. You have a ton of options here but they all depend upon your skill level. If you can edit the PHP files, then dive into the PHP pages that are being called (specials.php for example) and add the new functions that you desire or you could look for a contribution that does this for you (like how Featured Products contribution will automatically replace the New Products for Month code).

Hope this helped you out,


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Thank you very much for the answers and advices!

I installed the featured products contribution and edited the specials box (from specials.php) exactly how i wanted first :D

With the featured products contribution I have a small problem.. I edited the sts_templates.html and put in the middle column $featuredbox and below $content. The problem is: in every page i want to visit, I have Featured products and the content below (Shopping cart, products details, etc.) and i wanted it only in index.. i think i should make an index.php.html and that will solve the problem.. I'll check when I come back from work and I will tell you if i still having problems or i solved it :)

Many thanks again!

Share this post


Link to post
Share on other sites

Hi

I installed the system and it is BRILLIANT! I have one error though it seems I am missing a file the error is:

Template file does not exist: [includes/sts_templates/test/boxes/infobox.php.html]

I dont seem to have this file where can I find it?

Share this post


Link to post
Share on other sites

I solved the problem that I explain below :)

I have a problem (I think) with the featured products contribution... this contribution display me only one product in the featured products...

I tried to put more products and set it to display 6 products (as it is default) but doesn't work...

What could be the problem?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×