This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Porting my website design to ST


avatar
jfranco 0
From: -
Porting my website design to ST

I currently have a basic template of my current website design ( http://www.techspot.com) done in a WYSIWYG editor. I assume the best way to port this to StoryTeller would be going through the template system without having to modify any PHP files however as far as I know there is no guide explaining what template does what (other than indicating one is for faqs, other for downloads ,etc.) so I'm currently stuck trying to define within the templates what's my left and right sidebars among other things...

This is where I'm standing now:
 http://www.techspot.com/index9.php

Now obviously I would like to have the CMS fit my website needs rather that the other way around, could you please give some help on which should I edit for adding sidebars?

2) How about adding my own custom templates and having those integrated in the index or any other section template?

3) What does news_col_XXX or main_block_XXX stand for?

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Porting my website design to ST
avatar
0
From: -
Porting my website design to ST

Nice site!
1 Re: Porting my website design to ST
avatar
Administrator
1340
From: Vienna, Austria
Porting my website design to ST

Originally posted by jfranco:
I think I read in some other thread that the reason you can not use includes directly is because of the caching system used by the CMS. Does this mean that for any script I want to output using an include this won't be ran dynamically but will be sort of turned into static and refreshed a few times during an hour? (this is a good thing for the most part), and is this what the caching system is all about? I don't run TechSpot on an extremely powerful server so the caching thing is important however I don't want to lose in flexibility.

Most templates are using the caching system. The caching system generates static html which will be stored on the file system or in the database. There are a few templates (including site_header/site_footer) which are dynamically. I send you shortly another update for gallery/last10forum which will use a cache.

Storyteller was originally designed to handle 200000 pageviews/day on a Cobalt RaQ3 (AMD K6 300MHz) server. For the best performance, select Other => Config (in admin) and change "Caching Method" to "File Cache only" and "Log Referers" to "No". However, you will most likely run into OS limitations before maxing out your server. There are hardcoded limits in some Linux packages. For example: The default Apache package for Red Hat Linux has a hard limit of only 256 clients

Originally posted by jfranco:
One additional question... my plan is to move to the CMS for the frontpage news and comments at first instance, then to articles and downloads (etc) at a later time. So I will still be using static shtml files for most of my articles and sections around the site... I assume there will be no problem implementing news headlines and that sort of information using includes in those static files?

Yes, this is pretty easy. I will do this for you later.
1 Re: Porting my website design to ST
avatar
OP 0
From: -
Porting my website design to ST

Thank you Philipp, I will send a few attachments to your mail.
For the includes I have a couple of scripts and some static files that I want to have output in certain positions as well.

I think I read in some other thread that the reason you can not use includes directly is because of the caching system used by the CMS. Does this mean that for any script I want to output using an include this won't be ran dynamically but will be sort of turned into static and refreshed a few times during an hour? (this is a good thing for the most part), and is this what the caching system is all about? I don't run TechSpot on an extremely powerful server so the caching thing is important however I don't want to lose in flexibility.

One additional question... my plan is to move to the CMS for the frontpage news and comments at first instance, then to articles and downloads (etc) at a later time. So I will still be using static shtml files for most of my articles and sections around the site... I assume there will be no problem implementing news headlines and that sort of information using includes in those static files?
1 Re: Porting my website design to ST
avatar
Administrator
1340
From: Vienna, Austria
Porting my website design to ST

Originally posted by jfranco:
Now I have a question about templates, I don't seem to be able to make PHP includes directly into the header/footer templates. What can be done to normally use includes?

You need to change the include script. Here an example:

The original script:
<?php


echo "Current Date";
echo "<br /><br />";
echo "Today is ".date("l dS of F Y h:i:s A");

?>


To make this script an include for Storyteller:
<?php


$date_html = "Current Date";
$date_html .= "<br /><br />";
$date_html .= "Today is ".date("l dS of F Y h:i:s A");

?>


Basically, you need to change the script output to a variable. In this example the output will be written in $date_html. You can use $date_html everywhere in the template.

If you need help, send me your current site_header/footer and the script(s) that you like include.
1 Re: Porting my website design to ST
avatar
OP 0
From: -
Porting my website design to ST

Thanks for your help Philipp. I just went back to Storyteller implementation as things have been extremely busy with the site itself although I'd love to have the CMS up and running soon at least the frontpage/news part.

So far this is how I'm going:
 http://www.techspot.com/index9.php

Now I have a question about templates, I don't seem to be able to make PHP includes directly into the header/footer templates. What can be done to normally use includes?
1 Re: Porting my website design to ST
avatar
Administrator
1340
From: Vienna, Austria
Porting my website design to ST

Perhaps a white space character issue?

Anyway, check your email. I just send you site_header and site_footer templates based on your TechSpot layout. You need to upload both templates in ascii mode to your templates directory.
1 Re: Porting my website design to ST
avatar
OP 0
From: -
Porting my website design to ST

Originally posted by Philipp:
This is a small PHP script which get the latest 9 headlines and print it in the $left_menu variable.

You can use $left_menu everywhere in the template to show your lastest news headlines.
I did as you say however that didn't go well:  http://www.techspot.com/index9.php
1 Re: Porting my website design to ST
avatar
Administrator
1340
From: Vienna, Austria
Porting my website design to ST

Originally posted by jfranco:
I'm trying for example put latest news headlines in my left sidebar and not on those boxes at the top of the screen however I can't find the proper coding for doing this, Can I call a certain template within another template? Is this possible?

The news_blocks (and a few other parts) are limited to the main part of the website. This is mainly because of the currently used caching system.

However, it is still possible to use your headline block on the left site. Here is how:

Open the template site_header in an editor and add after global $insert; (on top of the template):
// TechSpot headlines block - START 


if (file_exists("cache/news/techspot-headlines.cah.php"))
{
require("cache/news/techspot-headlines.cah.php");
}
if ($headline_time < mktime())
{
dbconnect();
$currentdate = date("Y-m-d H:i:s", mktime());
$result = DBQuery("SELECT * FROM esselbach_st_stories WHERE story_hook = '0' AND story_time < ('$currentdate') ORDER BY story_time DESC LIMIT 9");
while ($insert = mysql_fetch_array($result))
{
$left_menu .= <<<HTML_LEFT_MENU
<tr><td width="100%" class="leftmenu">
<a href="https://www.contentteller.com/story.php?id=$insert[story_id]">$insert[story_title]</a></td></tr>
<tr><td width="100%" class="leftmenu" height="1">
<img border="0" src="https://www.contentteller.com//images/dots2.gif" width="131" height="1"></td></tr>
HTML_LEFT_MENU;
}
$headline_time = mktime() + 900; // Caching the headlines for 15 minutes
$left_menu = addslashes($left_menu);
MiniCache("cache/news/techspot-headlines", "<?php $headline_time = "$headline_time";n $left_menu = "$left_menu"; ?>");
}
$left_menu = stripslashes($left_menu);

// Last 9 headlines block - END

This is a small PHP script which get the latest 9 headlines and print it in the $left_menu variable.

You can use $left_menu everywhere in the template to show your lastest news headlines.

Originally posted by jfranco:
Regarding my previous questions about left and right sidebars, what happens if I want to have certain information displayed in the frontpage and some different info displayed in those sidebars for reviews, etc? Then it would make no sense putting that up on the general header/footer... what's your recommended solution?

This could be done with additional PHP code in the site_header or footer template.

Here an example:
if (preg_match("/review.php/i",$_SERVER[PHP_SELF]))

{
$output = HTML_OUTPUT
<b>Review HTML here</b>
HTML_OUTPUT;
}

This example is for review.php

You can always send me an email with your templates and I'll will do the smaller modifcations for you.
1 Re: Porting my website design to ST
avatar
OP 0
From: -
Porting my website design to ST

Thanks for your continued support Philipp.

I continue to work on this however I'm still having a hard time understanding how to get around things in order to completely customize my site...

1) Regarding my previous questions about left and right sidebars, what happens if I want to have certain information displayed in the frontpage and some different info displayed in those sidebars for reviews, etc? Then it would make no sense putting that up on the general header/footer... what's your recommended solution?

2) I'm trying for example put latest news headlines in my left sidebar and not on those boxes at the top of the screen however I can't find the proper coding for doing this, Can I call a certain template within another template? Is this possible?

3)More than lilkely I will want to use the information you usually display on those boxes from your default templates however I'm definitely not going after the 'generic' CMS look (which you will agree is never the idea) instead I would like to have this information displayed according to my needs and site design... the problem I'm having above is one example, another is that I enabled the news headlines however for some reason I get two lists of headlines, very strange... Please see:  http://www.techspot.com/index9.php

4) Related to the questions above, I don't want login info displayed on the default location but inside my header... this is probably one of the many things I will want to have moved from the default locations, how do I manage to do this?
1 Re: Porting my website design to ST
avatar
Administrator
1340
From: Vienna, Austria
Porting my website design to ST

Originally posted by jfranco:
Now obviously I would like to have the CMS fit my website needs rather that the other way around, could you please give some help on which should I edit for adding sidebars?

You find always the names of the used templates in the website HTML source code.

The left sidebar belongs in the site_header template and the right sidebar in the site_footer template.

Originally posted by jfranco:
2) How about adding my own custom templates and having those integrated in the index or any other section template?

You need to create an empty template file, for example techspot_test1.tmp.php with the following content:
<?php

global $insert;
$EST_TEMPLATE = <<<TEMPLATE

TEMPLATE;
?>

Then upload the template in your /templates directory. The template should appear now in the template editor.

To call the template from one of the scripts:
echo GetTemplate("techspot_test1");

or if the script is writing the HTML in a variable:
$variable .= GetTemplate("testspot_test1");

You need to replace $variable with the variable used in the script.

Let me know if you need help with the templates. I could adapt the basic layout for you.

Originally posted by jfranco:
3) What does news_col_XXX or main_block_XXX stand for?

The news_col_* templates are used for the optional two column news display on the frontpage. main_block_* are the news block templates which will be used for the optional news blocks.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.