PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Developers Corner ::  0.8 Theme Design ::  Smarty question in PN.8 RC2

Moderated by: Support Team

Bottom
Smarty question in PN.8 RC2

  • Link to this postingPosted: 17.01.2008, 18:22
    Profile Homepage
    jaenosjelantru
    rank:
    pnHelper pnHelper
    registered:
     March 2005
    Status:
    offline
    last visit:
    30.04.08
    Posts:
    124
    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.
  • Link to this postingPosted: 17.01.2008, 19:13
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    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 theme 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
  • Link to this postingPosted: 17.01.2008, 19:21
    Profile Homepage
    AmmoDump
    rank:
    pnProfessional pnProfessional
    registered:
     December 2003
    Status:
    offline
    last visit:
    08.05.08
    Posts:
    2635
    http://community.postnuke...wtopic-topic-52535.htm

    Here is an example of how the logic can extend.

    -----
    -- David Pahl -- (PostNuke Support Team)

    <div id="me" class="none" style="none" />

  • Link to this postingPosted: 17.01.2008, 19:36
    Profile Homepage
    jaenosjelantru
    rank:
    pnHelper pnHelper
    registered:
     March 2005
    Status:
    offline
    last visit:
    30.04.08
    Posts:
    124
    Excellent, thanks for the help and links...
  • Link to this postingPosted: 22.01.2008, 19:40
    Profile Homepage
    jaenosjelantru
    rank:
    pnHelper pnHelper
    registered:
     March 2005
    Status:
    offline
    last visit:
    30.04.08
    Posts:
    124
    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.
  • Link to this postingPosted: 23.01.2008, 15:31
    Profile Homepage
    AmmoDump
    rank:
    pnProfessional pnProfessional
    registered:
     December 2003
    Status:
    offline
    last visit:
    08.05.08
    Posts:
    2635
    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 -- (PostNuke Support Team)

    <div id="me" class="none" style="none" />

  • Link to this postingPosted: 23.01.2008, 17:39
    Profile Homepage
    Herr.Vorragend
    rank:
    pnSoftmore pnSoftmore
    registered:
     July 2004
    Status:
    offline
    last visit:
    23.03.08
    Posts:
    89

Start ::  Developers Corner ::  0.8 Theme Design ::  Smarty question in PN.8 RC2

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke