This is a discussion on New Static Page without columns within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; hi - looking for some help / ideas... I need add a new page to my site that shows the ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| hi - looking for some help / ideas... I need add a new page to my site that shows the header and footer, but does not show the left and right columns. I want the page to be editable with the wysiwyg editor from the admin panel. I have been able to add a new static page and edit it with the wysiwyg editor, but I don't see how I can remove the left and right columns only for that page. Any ideas? thanks! |
|
#2
| |||
| |||
| 1) create a program to load the page (aaaa.php) which is what is called. [like articles.php] 1a) in aaaa.php make sure you have something that says $sideout = 1; 2) pass the page content id [aaaa.php?content=static.html] 3) go into the templates and change the main_page.tpl.php so that the calls to the left and right side have if statements around them that say if (!$sideout) { // here make the call to the sideboxes } And there you have ONE way of doing it. The key is the logic added to the template code to turn the sides on and off and then SOME way to set the flag. That info could be passed in on the get, set in a cookie, etc.
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
|
#3
| ||||
| ||||
| Another way using BTS is to just make a new main template and call it something else, line main_no_column.tpl.php and remove the left and right columns from it. Then create your new page and instead of it using main_page.tpl.php as its base, have it use main_no_column.tpl.php instead. That is the easiest way to do it that I can think of.
__________________ Michael Sasek osCMax Developer
|
|
#4
| |||
| |||
| Thanks Michael - I understand that now, the part I still don't get (a little thick today) is how / where i "have it use main_no_column.tpl.php instead" . |
|
#5
| ||||
| ||||
| If you look in a page base file (a file in the catalog directory like shipping.php), you will see that they call main_page.tpl.php. You would just change that call to your new main template. Look for: PHP Code: PHP Code:
__________________ Michael Sasek osCMax Developer
|
| The Following User Says Thank You to michael_s For This Useful Post: | ||
mc8 (08-11-2007) | ||
|
#6
| |||
| |||
| I hate to be repetitive, but that is going to be a maintenance nightmare... here is a small portion of a diff between the original and a modified main_page.tpl.php diff templates/a/main_page.tpl.php templates/a/main_page.tpl.php-orig.txt Code:
13,15d12
< <link rel="stylesheet" href="/includes/windowfiles/dhtmlwindow.css" type="text/css">
< <script type="text/javascript" src="/includes/windowfiles/dhtmlwindow.js">
< </script>
30,31c27
< <link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_TEMPLATES; ?>coolmenu.css">
< <link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_TEMPLATES; ?>gtabs.css">
---
> <link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_TEMPLATES; ?>/coolmenu.css">
37,38d32
<
<
111d104
<
129c122
< <table width="100%" height=52 cellpadding="0" cellspacing="0" border="0" align="center">
---
> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
135c128
< <table border="0" width="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-color:#cccccc">
---
> <table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-color:#cccccc">
138,144d130
< <? // added BIA SEO Optimization
< if ((int)$HTTP_GET_VARS['products_id'] != "") {
< require(DIR_WS_FUNCTIONS . 'seo.php');
< echo getheaderdiv($HTTP_GET_VARS['products_id']);
< }
< // ended seo optimization div
< ?>
146c132
< <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color:#ffffff;">
---
> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url(<?php echo DIR_WS_TEMPLATES;?>/images/headerbg.jpg); background-color:#0099CC;">
148c134
< <td width="298" valign="top" style="padding-left:4px; "><table border=0 cellpadding=0 cellspacing=0><tr><td><A HREF="<?php echo tep_href_link(FILENAME_DEFAULT);?>"><img border="0" src="<?php echo DIR_WS_TEMPLATES;?>/images/logo-top.gif" alt="<?php echo STORE_NAME;?>" title="<?php echo STORE_NAME;?>"></a></td><tr><tr><td><img border="0" src="<?php echo DIR_WS_TEMPLATES;?>/images/tagline.gif" alt="<?php echo STORE_NAME;?>" title="<?php echo STORE_NAME;?>"><td></tr></table></td>
---
While using duplication of the main template is an option, it's not a good kluge. It's fast, and it means less code initially, but in the long term it could mean much more work if you are making design changes that are structural at the page level. It's sort of the same logic that BTS uses in only taking from the /content area those pieces of /content that are not standard. The idea is to reduce maintenance complexity. again, this is just my $0.02 based on having to maintain these things. YMMV.
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
| The Following User Says Thank You to met00 For This Useful Post: | ||
mc8 (08-11-2007) | ||
|
#7
| ||||
| ||||
| Quote:
If managing many sites with customizations, many different templates, this would be a bad option. On the other hand, if managing a single site and single template set, this is a great option that poses no long term problems. Just adding a single main template file, editing a single line in any pages that use the new template, and it is done. No muss. No fuss. Quote:
This solution is not for every application, , but it is good to know it is an option. Along those lines, I was thinking about a better way to extend BTS and it looks very easy to simply add a second and third case for main templates in the bts_select function in config_bts.php. It would be very easy to just add new template cases, and then simply specify this option in the bts_select include. That allows you to create unlimited main page templates without breaking out of the BTS function calls.
__________________ Michael Sasek osCMax Developer
|
|
#8
| |||
| |||
| Thank you both met00 and Michael - Sorry to have started a design debate ... I understand the pros and cons of each solution...going with Michaels for now as it is only a one-off single page, but will surely will use the met00 solution for other situations. thanks again! |
|
#9
| ||||
| ||||
| Its all good. Talking about the many options and the pros and cons has spurred some new ideas, as usual. No need to apologize for kick starting a good discussion. That is what this place is all about.
__________________ Michael Sasek osCMax Developer
|
|
#10
| |||
| |||
| I concur. The way one programmer would resolve and issue and the way another would differ based on everything from their general programming experience to their knowledge of specific that differ. For instance, I would never have looked at the BTS code the way Michael did. I was looking at not creating and maintaining more files, so that generally means more if-then-else logic to determine what should and shouldn't be done at processing time. Michael knows the BTS code far better than I, so he started looking there for the solution. And that is the good part of having these levels of discussion.
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add Printer Friendly Page to Static Pages? | mjfontec | osCMax v2 Customization/Mods | 0 | 04-01-2007 07:37 PM |
| Added a new static page | countingsheep | osCMax v2 Customization/Mods | 4 | 05-17-2006 08:23 PM |
| Adding FCKEditor Access Capabilites to new "static page | dwsjr | osCMax v2 Customization/Mods | 1 | 11-27-2005 08:20 PM |
| How do I add HTML to My Newly Created Static Page | Anonymous | osCMax v1.7 Discussion | 3 | 08-01-2005 05:47 AM |
| Static Page | neo14706 | osCommerce 2.2 Modification Help | 0 | 04-24-2003 05:55 AM |