PDA

View Full Version : Template selection



jsp_1983
09-25-2005, 05:26 PM
Hi,

This might sound like an incredibly stupid question, but how do I select the template I want to use from the administration control panel?

I know where and how to do it in the Reloaded version of OSC, but OSCMax is quite confusing to me!

Also, I am assuming the method of template creation is different to the method used on Reloaded? Are there any FAQs on creating them in OSCMax?


Thanks!

neil
09-26-2005, 04:15 AM
http://www.oscdox.com/phpWiki.html

webmissie1
09-26-2005, 08:13 AM
What are the differences in the supplied templates? How do we know which one to use at the start? thanks

michael_s
09-26-2005, 08:15 AM
To specifically answer your question about changing the default template, it is really easy:

In the admin under Configuration, click on Default Template Directory and change the directory name to the actual teplate directory name you want to use. It is set by default to aabox, but you can change it to osC, or whatever template you are using.

webmissie1
09-26-2005, 09:16 AM
What I mean to ask is whether or not the different templates affect the fuctionality of the program or do they all work the same, just look different. I am not familiar with templates, I customized a stock osc site from scratch as my first project years ago so all these fanciful features have me a little confused at the start of a new project using this great package..

michael_s
09-26-2005, 11:07 AM
Pick whichever template you want. There is no difference in function, they just look different. They are samples for you to check out, but really it does not matter which you start with...

webmissie1
10-06-2005, 07:01 AM
am I supposed to be modifying the files in templates/fallback/content even when Im using the other templates. I dont understand why there is no content folder in the other template folders.

jpf
10-06-2005, 12:19 PM
There is ONLY one file you really need to change - main_page.tpl.php and the CSS. IF and ONLY IF you need to change something else that is very specifice then COPY that file over to your template ... DO NOT CHANGE THE "fallback" unless your adding a mod....

jsp_1983
10-17-2005, 12:56 PM
I've tried searching, to no avail.

In STS, I've found you keep each template's images (info buttons etc) in an images folder in that template's folder.

I can't find any similar system for BTS- are you just expected to keep manuaully replacing images in the default /image folder each time you change templates?

jpf
10-20-2005, 08:43 AM
I have found the instruction do to so. Strange that it has not BEEN merged into the core of BTS....YET...

Maybe it will be added into next version for osCMax...

Intructions:


How to add different images, buttons etc to each theme with BTS. (In 4 easy steps:

All default graphics normally can be found in
/catalog/includes/languages/< language >/images/
/catalog/includes/languages/< language >/images/buttons/...
/catalog/includes/languages/< language >/images/icon.gif

If you theme should use default images don't copy anything.

=================================================
1. Copy all folders from /catalog/includes/languages/ to your template folder

You should have this:
/catalog/templates/< template folder >/< language 1>/images/buttons/...
/catalog/templates/< template folder >/< language 1>/images/icon.gif
...
/catalog/templates/< template folder >/< language N>/images/buttons/...
/catalog/templates/< template folder >/< language N>/images/icon.gif

=================================================
2. Delete unneeded files with language strings
/catalog/templates/< template folder >/< language N>/*.php

=================================================
3. Open /catalog/includes/functions/html_output.php

FIND THIS-(Aprox line 309):


////
// Output a function button in the selected language
function tep_image_button($image, $alt = '', $parameters = '') {
global $language;

return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
}

REPLACE WITH:


////
// Output a function button in the selected language
function tep_image_button($image, $alt = '', $parameters = '') {
global $language;
if(file_exists($tplDir . $language .'/images/buttons/' . $image)) {
return tep_image($tplDir . $language .'/images/buttons/' . $image, $alt, '', '', $parameters);
} else {
return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
}
}


FIND THIS-(Aprox line 294):


////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
function tep_image_submit($image, $alt = '', $parameters = '') {
global $language;

$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

$image_submit .= '>';

return $image_submit;
}

REPLACE WITH:


////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
function tep_image_submit($image, $alt = '', $parameters = '') {
global $language;

if(file_exists($tplDir . $language. '/images/buttons/' . $image)) {
$image_submit = '<input type="image" src="' .
tep_output_string($tplDir . $language. '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
} else {
$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language .
'/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
}

if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

$image_submit .= '>';

return $image_submit;
}

4. For different language icons open /catalog/includes/boxes/languages.php
FIND THIS-(Aprox line 33)


while (list($key, $value) = each($lng->catalog_languages)) {
$boxContent .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
}

REPLACE WITH:


while (list($key, $value) = each($lng->catalog_languages)) {
if(file_exists($tplDir . '/'.$value['directory'] . '/images/' . $value['image'])) {
$boxContent .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) .
'language=' . $key, $request_type) . '">' . tep_image($tplDir . '/'. $value['directory'] . '/images/' . $value['image'],
$value['name']) . '</a> ';
} else {
$boxContent .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) .
'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' .
$value['image'], $value['name']) . '</a> ';
}
}
Done!


Change graphics as needed - next time you change the template it will also use the changed graphics if available also!