Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Smarty question in PN.8 RC2
  • Posted: 17.01.2008, 23:22
     
    jaenosjelantru
    rank:
    Helper Helper
    registered:
     March 2005
    Status:
    offline
    last visit:
    17.11.08
    Posts:
    358

    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 ]
  • Posted: 18.01.2008, 00:13
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    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
  • Posted: 18.01.2008, 00:21
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    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
  • Posted: 18.01.2008, 00:36
     
    jaenosjelantru
    rank:
    Helper Helper
    registered:
     March 2005
    Status:
    offline
    last visit:
    17.11.08
    Posts:
    358
    Excellent, thanks for the help and links...

    --
    [ stevencopley.com ]
  • Posted: 23.01.2008, 00:40
     
    jaenosjelantru
    rank:
    Helper Helper
    registered:
     March 2005
    Status:
    offline
    last visit:
    17.11.08
    Posts:
    358

    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 ]
  • Posted: 23.01.2008, 20:31
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    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
  • Posted: 23.01.2008, 22:39
     
    Herr.Vorragend
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    17.11.08
    Posts:
    109
    AmmoDump is right.

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

    --
    Carsten-volmer.de
    Saga-Treff.de

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula