Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add to config define pages admin list

Add to config define pages admin list

Locked

Views: 2,800

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
23 Aug 2006, 12:45 AM
#1
gwmbox avatar

gwmbox

New Zenner

Join Date:
Feb 2005
Posts:
38
Plugin Contributions:
0

Add to config define pages admin list

Hi guys

I am still searching and reading many posts on this one as there seems to be many asking for it.

Anyway first I am not using EZ-pages as I find the define pages editor more simple and have not found an effective ez-pages tutorial - but that's another topic.

So back to define pages problem I need help with.

Adding new pages is a breeze with the aid of the help of the About_Us tutorial/example.

However I want to be able to turn pages on or off just like the other define pages from the Configuration - Define Pages admin section - but when I add new pages they are not auto listed here - is there something I missed or something else I need to do - please help.

Cheers

23 Aug 2006, 2:48 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Add to config define pages admin list

The About Us contribution was intentionally designed to not provide switches for turning the page on/off, because the coding to set up all the conditional logic is too tough for most newbies to comprehend.

If you want to do it, you need to:
A. add the switches into the database, following the pattern:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Conditions of Use', 'DEFINE_CONDITIONS_STATUS', '1', 'Enable the Defined Conditions of Use Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', 25, 75, now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

B. add the conditions to your sidebox, following the pattern:```
if (DEFINE_CONDITIONS_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>';
}


C. You probably don't need to support the switch settings for "2" and "3", but if you do, then you need to follow the pattern in your template file:```php
<?php if (DEFINE_CONDITIONS_STATUS >= 1 and DEFINE_CONDITIONS_STATUS <= 2) { ?>
<div id="conditionsMainContent" class="content">
<?php
/**
 * require the html_define for the conditions page
 */
  require($define_page);
?>
</div>
<?php } ?>

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Aug 2006, 3:27 AM
#3
gwmbox avatar

gwmbox

New Zenner

Join Date:
Feb 2005
Posts:
38
Plugin Contributions:
0

Re: Add to config define pages admin list

Worked perfect - thank you so much and for a such a quick response

23 Aug 2006, 3:37 AM
#4
gwmbox avatar

gwmbox

New Zenner

Join Date:
Feb 2005
Posts:
38
Plugin Contributions:
0

Re: Add to config define pages admin list

Oh and if you want it to be added to the site map

add code

            <?php if (DEFINE_ABOUT_US_STATUS <= 1) { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_ABOUT_US) . '">' . BOX_INFORMATION_ABOUT_US . '</a>'; ?></li>
            <?php } ?>

to the tpl_site_map_default.php in your template folder :)

10 Jun 2009, 4:36 AM
#5
thegeeksstore_com avatar

thegeeksstore_com

New Zenner

Join Date:
Jun 2009
Location:
DFW. Texas
Posts:
1
Plugin Contributions:
0

Re: Add to config define pages admin list

DrByte, We want to thank you for your post. This post has been here a while, as the date so clearly states, but it was still very helpful for us. As easy as that was, we will add all of our pages with these steps.
Thanks again,
Nick and Keith

I would rather be hated for what I am, than loved for what I am not.
Our Zen Store: www.thegeeksstore.com