Data at Your Fingertips: Explore Our New Reporting and Statistical Capabilities By Ryan Ashbrook Yesterday at 01:29 PM
Jyosua Posted January 16 Share Posted January 16 I'm attempting to upgrade to the latest version of the forum software, so I'm porting over some of our customizations, but for some reason I can't get the theme to load a custom template file. In forums>front>topics>postContainer, on line 92, I've added an else condition to load a template bit: {{if !$comment->isAnonymous()}} <li data-role='group'>{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}</li> {{if \IPS\Member\Group::load( $comment->author()->member_group_id )->g_icon }} <li data-role='group-icon'><img src='{file="$comment->author()->group['g_icon']" extension="core_Theme"}' alt='' class='cAuthorGroupIcon'></li> {{else}} <!-- this is the else --> {template="memberBadge" app="core" group="global" params="$comment->author()"} <!-- this is the template --> {{endif}} {{endif}} That template, memberBadge, resides under core>global>global. For whatever the reason, I can't get it to load, even if it's just static html in the template or text. If I put text like "test" under the else condition instead, I see it displayed under the member group name, but if I put nothing but that "test" text in the template, it doesn't display. This worked just fine in the old version, so I'm not sure what I'm missing. Link to comment Share on other sites More sharing options...
Solution Nathan Explosion Posted January 16 Solution Share Posted January 16 38 minutes ago, Jyosua said: I'm attempting to upgrade to the latest version of the forum software, so I'm porting over some of our customizations, but for some reason I can't get the theme to load a custom template file. In forums>front>topics>postContainer, on line 92, I've added an else condition to load a template bit: {{if !$comment->isAnonymous()}} <li data-role='group'>{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}</li> {{if \IPS\Member\Group::load( $comment->author()->member_group_id )->g_icon }} <li data-role='group-icon'><img src='{file="$comment->author()->group['g_icon']" extension="core_Theme"}' alt='' class='cAuthorGroupIcon'></li> {{else}} <!-- this is the else --> {template="memberBadge" app="core" group="global" params="$comment->author()"} <!-- this is the template --> {{endif}} {{endif}} That template, memberBadge, resides under core>global>global. For whatever the reason, I can't get it to load, even if it's just static html in the template or text. If I put text like "test" under the else condition instead, I see it displayed under the member group name, but if I put nothing but that "test" text in the template, it doesn't display. This worked just fine in the old version, so I'm not sure what I'm missing. app = core location = global group = global {template="memberBaddge" app="core" location="global" group="global" params="$comment->author()"} If you had it in core -> front -> global then your code would be fine as postContainer is in front too. Link to comment Share on other sites More sharing options...
Jyosua Posted January 16 Author Share Posted January 16 (edited) Yep, that was the issue. Thanks for the help! Is there somewhere in the dev docs where this is documented? I did some googling and skimming of the docs, but I didn't see anything that looked like it'd explain the full behavior of the template arguments. Edited January 16 by Jyosua Link to comment Share on other sites More sharing options...
teraßyte Posted January 16 Share Posted January 16 Link to comment Share on other sites More sharing options...
Jyosua Posted January 17 Author Share Posted January 17 Thanks, this is exactly what I would have wanted. I wonder why there isn't a link to this part of the documentation from the getting started? I think it'd be good to direct people there if they want to read in further detail, since the title of that dev docs page doesn't really yell "templates!" to me. Link to comment Share on other sites More sharing options...
Recommended Posts