Quote Originally Posted by oboeonetwothree View Post
Has anyone successfully wrapped this template mod with a template that includes navigation elements (ie., home, about, contact) and account elements (ie. login/logout, my account)?

More specifically, I want "login" to change to "logoff" when a person is logged in, and vice versa. The culprit is likely the session variables, although they should be accessible since the zencart directory is on the same server as the home, about, and contact web pages, which are in the website root.

I thought the code below should work:

PHP Code:
                <?php if ($_SESSION['customer_id']) { ?>
                <li><a href="<?php print("$webroot"."$shop");?>index.php?main_page=login">Logout</a></li>
            <?php
                  
} else {
                    if (
STORE_STATUS == '0') {
            
?>
                <li><a href="<?php print("$webroot"."$shop");?>index.php?main_page=login">Login</a></li>
            <?php } } ?>
I saw an example with a bunch of zen_href_link references, so I was wondering if those additions to the code are necessary, with ez-pages that link to my "external"(outside zen cart) pages.

Hopefully this topic is relevant enough - I figured not too many other people would see a reason for this workaround.

I would move the zen-cart files into the website root, but:
  • Then there is the issue of two index.php's(since it was recommended not to change the name of zen-cart's index.php-the product/shop page- and I'm not sure how to change index.php -the home page- or if that would impact SEO).
  • And having all of the zencart files floating in the website root would make the file structure less organized.
what you seem to be asking one fundamental question here can you run php in the markup file.
the answerer is yes how ever I have had trouble in the past w/ having to run chdir's and includes. how ever the template file is pre-parsed before any thing is divided up. so if you are mixing up you html w/ php it might break.
how ever using zen cart functions should not be a problem since application top has already been run at the time that the sang embed is included.

JOsh