[Pro] PHP Code In CSS Menus Action

Hi Everyone,

We are implementing a shopping cart script into a Freeway Document. I am trying to add two

  • items to our CSS Menus Action that only appear if user is logged in.

    Below I have included the code Freeway is outputting from my test. The Welcome, Contact and View Cart tag were inputed regularly. I then returned to a new line and inserted a Markup Item. I inserted my PHP code which adds the two additional links if user is logged in. As you can see Freeway is creating a

  • tag around my markup code. How can I stop Freeway from doing this?

    [code]


    	<!--Typed In Regularly-->
    	<li class="fwFirstChild fwNavItem"><a href="#" class="fwCurrent">Welcome</a></li>
    	<li class="fwNavItem"><a href="contact.php">Contact</a></li>
    	<li class="fwNavItem"><a href="viewcart.php?ac=shoppingCart">View Cart</a></li>
    	<!--End Of Typed In Regularly-->
    
    	<!--Freeway Created List Item-->
    	<li class="fwLastChild fwNavItem"><a href="#" style="cursor:default">							
    
    	<!--Code I Put In Markup Item-->
    	<?php
    	if ($_REQUEST['ac'] != 'pastOrders' && isClientLogged()) {
    	?>
    	<li class="fwFirstChild fwNavItem"><a href="general.php?ac=pastOrders" title="<?php echo $SC_LANG['nav_orders'];?>">Past Orders</a></li>
    	<?php
    	}
    	if (isClientLogged()) {
    	?>
    	<li class="fwFirstChild fwNavItem"><a href="<?php echo _SELF_;?>?ac=logout" title="<?php echo $SC_LANG['nav_logout'];?>">Logout</a></li>
    	<?php
    	}
    	?>
    	<!--End On Code In Markup Item-->
    
    	</a></li>
    	<!--End Of Freeway Created List Item-->
    
    	</ul>
    
    [/code]

    Thank you for your help,

    Team SDA
    Christian


    freewaytalk mailing list
    email@hidden
    Update your subscriptions at:
    http://freewaytalk.net/person/options

  • The Crowbar Action is designed for this sort of thing. Put an inline Crowbar in the list along with the other static navigation elements, add your code through its interface, and when you publish, Crowbar will recognize that it is all alone on a line and remove the Freeway-generated enclosing tag.

    It will then be your code’s responsibility to wrap its output in

  • tags, but you know how to do that.

    Walter


    freewaytalk mailing list
    email@hidden
    Update your subscriptions at:
    http://freewaytalk.net/person/options

  • Hi Walter,

    Thank you, that works perfectly.

    Team SDA_Christian


    freewaytalk mailing list
    email@hidden
    Update your subscriptions at:
    http://freewaytalk.net/person/options

    Hi Walter,

    If I could ask one more thing. I have a login on the bottom of all my pages. Once the user logs in, I am using PHP to hide it.

    I have a couple input elements grouped on the bottom of the page with the Multiple Form Action applied. I need to put PHP code before and after the opening and closing tags. I’ve tried using CrowBar on the item but the “Beginning” or “End” options don’t allow you to put the code before or after the tags.

    Am I using CrowBar incorrectly? Is there another action to accomplish this?

    Christian


    freewaytalk mailing list
    email@hidden
    Update your subscriptions at:
    http://freewaytalk.net/person/options