Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

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

The test folder should only be used to confirm that you have installed STS correctly. Now that it is installed, change the template folder to "full" in the STS Default module in the admin.

 

Basically, the error message is telling you a folder/file is missing. The test folder by design does not include the infobox template folder and you implemented the infobox template feature therefore causing the error message to display.


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

 

Lalu,

 

Your Featured Products questions would be better asked in the support thread for Featured Products.


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 bkellum,

 

Thanks for the prompt reply.

 

My #2 above...

"includes/sts_templates/test/sts_blank_template.html" file

shows the code I have used.

 

 

#3 Shows the screenshot of what the browser displays.

 

As you can see $breadcrumbs is displaying the correct information.

 

Whereas, $categorybox is NOT displaying correctly.

 

 

I have used "includes/sts_templates/full/sts_template.html" as a default template and it's still the same problem.

I have checked if I installed all the files and it seems I have.

 

I still can't nail the problem.

 

Thanks

vj

Share this post


Link to post
Share on other sites
Hi bkellum,

 

Thanks for the prompt reply.

 

My #2 above...

"includes/sts_templates/test/sts_blank_template.html" file

shows the code I have used.

 

 

#3 Shows the screenshot of what the browser displays.

 

As you can see $breadcrumbs is displaying the correct information.

 

Whereas, $categorybox is NOT displaying correctly.

 

 

I have used "includes/sts_templates/full/sts_template.html" as a default template and it's still the same problem.

I have checked if I installed all the files and it seems I have.

 

I still can't nail the problem.

 

Thanks

vj

Share this post


Link to post
Share on other sites
Hi bkellum,

 

Thanks for the prompt reply.

 

My #2 above...

"includes/sts_templates/test/sts_blank_template.html" file

shows the code I have used.

 

 

#3 Shows the screenshot of what the browser displays.

 

As you can see $breadcrumbs is displaying the correct information.

 

Whereas, $categorybox is NOT displaying correctly.

 

 

I have used "includes/sts_templates/full/sts_template.html" as a default template and it's still the same problem.

I have checked if I installed all the files and it seems I have.

 

I still can't nail the problem.

 

Thanks

vj

 

greetings vj

 

I am experiencing the same problem so I would be pleased to hear if you have found the answer.

 

regards

David

Share this post


Link to post
Share on other sites

I can't find your screenshots coober but for me the infobox variables are not being replaced so things like $categorybox are showing in the rendered HTML. The other variables OTHER than infoboxes seem to be working fine though. I triple checked my installation, used the full template, made sure the infobox templating option was enabled too....

Edited by thesubmitter

Share this post


Link to post
Share on other sites
greetings vj

 

I am experiencing the same problem so I would be pleased to hear if you have found the answer.

 

regards

David

David,

Not knowing or having access to your code, I would be willing to bet that you did not upload the files in the sts_inc folder, specifically includes/modules/sts_inc/sts_column_left.php file.


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

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

×