Smarty question in PN.8 RC2  Bottom

  • Code

    <div id="theme_navigation_bar">
    <ul>
    <!--[if pnuserloggedin($loggedin) eq 1]--><li><a href="<!--[pngetbaseurl]-->">Home</a></li>
    <li<!--[if $module eq 'Content']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Content&func=view&pid=1]-->">What We do</a></li>
    <li<!--[if $module eq 'Profile']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Profile]-->"><!--[pnml name="_YOURACCOUNT"]--></a></li>
    <!--[else]-->
    <li><a href="<!--[pngetbaseurl]-->">Home</a></li>
    <li<!--[if $module eq 'Search']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Search]-->"><!--[pnml name="_SEARCH"]--></a></li>
    <li<!--[if $module eq 'Profile']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Profile]-->"><!--[pnml name="_YOURACCOUNT"]--></a></li>
    <!--[/if]-->
    </ul>
    </div>


    Im trying to change a navigation bar based on if the user is logged in. This is working from a modified Andreas theme. I get the following Smarty error at line 28, which is at the

    Code

    <!--[if pnuserloggedin($loggedin) eq 1]--><
    section:

    System Error
    Critical error
    An unknown error has occured. The following error message was returned by the system

    Smarty error: [in master.htm line 28]: syntax error: invalid attribute name: '=' (Smarty_Compiler.class.php, line 1547) (in file C:\Program Files\xampp\htdocs\dco\includes\classes\Smarty\Smarty.class.php on line 1095)


    HELP!!!, I know this is something simple and I'm a total n00b at Smarty.

    --
    [ stevencopley.com ]
  • The problem is the pnuserloggedin($loggedin) part of your template logic. You're mixing the use of template functions and template variables.

    If using the pnuserloggedin tag you'd use it like

    Code

    <!--[pnuserloggedin assign=loggedin]-->
    <!--[if $loggedin eq true]-->
    ...
    <!--[/if]-->


    However you don't need to do this since we assign you the result of pnuserloggedin by default. See this list of default… template variables. So you can simply use

    Code

    <!--[if $loggedin eq true]-->
    ...
    <!--[/if]-->


    See our Theme authoring documentation for additional information on the theming system.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • http://community.postnuke.com/module-Forum-viewtopic-topic-52535.htm

    Here is an example of how the logic can extend.

    --
    David Pahl
    Zikula Support Team
  • Excellent, thanks for the help and links...

    --
    [ stevencopley.com ]
  • Code

    <!--[if $loggedin eq true]-->...<!--[/if]-->


    Mark, this did not work. I looked through the links and based on what I've seen, that would be the correct syntax, but it simply is not doing what it should be. Am I missing something? I can send someone the entire template to look at if needed.

    --
    [ stevencopley.com ]
  • As far as I can see the loggedin part should work...

    Code

    <!--[pnmodurl modname=Content&func=view&pid=1]-->


    I do not think you can do that.... modname is Content not the complete path.

    Code

    <!--[pnmodurl modname="Content" type="user" func="view" pid="1"]-->






    --
    David Pahl
    Zikula Support Team
  • AmmoDump is right.

    Please look here, too: http://community.postnuke.com/module-Forum-viewtopic-topic-52978-start-0.htm#pid233327

This list is based on users active over the last 60 minutes.