Jump to content
  • Status: Not a bug

Hi! I have a custom page with raw HTML and i'm getting this error "Error: Call to undefined method IPS\forums\Forum::getMemberView() ". The page now keeps infinitely loading for some reason.Scherm­afbeelding 2025-03-19 om 14.35.07.png

User Feedback

Recommended Comments

Marc

Invision Community Team

If this is a custom page, you would need to look at your custom code to correct this issue

Thomas Hop

Clients

Below is my code, but it should recognize "getMemberView()" as a function as it's native to Invision or am I wrong?

<section>

<ol class='ipsList_reset cForumList'  data-baseURL=''>

{{foreach \IPS\forums\Forum::roots() as $category}}

      {{if $category->id == 1}}

{{if $category->can('view') && $category->hasChildren()}}

<li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom'>

<h2 class="ipsType_sectionTitle ipsType_reset cForumTitle">

{{if $category->icon}}

<img src="{file="$category->icon" extension="forums_Icons"}" alt='' class='ipsItemStatus mainCatIcon'>

{{endif}}

<p class='ipsPos_right ipsJS_show ipsType_noUnderline cForumToggle' data-action='toggleCategory' data-ipsTooltip title='{lang="toggle_this_category"}'> </p>

<p>{$category->_title}</p>

</h2>

{{if \IPS\forums\Forum::getMemberView() === 'grid'}}

<div class='ipsAreaBackground ipsPad' data-role="forums">

<div class='ipsGrid ipsGrid_collapsePhone' data-ipsGrid data-ipsGrid-minItemSize='250' data-ipsGrid-maxItemSize='500' data-ipsGrid-equalHeights='row'>

{{foreach $category->children() as $forum}}

{template="forumGridItem" group="index" app="forums" params="$forum"}

{{endforeach}}

</div>

</div>

{{else}}

<ol class="ipsDataList ipsDataList_large ipsDataList_zebra ipsAreaBackground_reset" data-role="forums">

{{foreach $category->children() as $forum}}

{template="forumRow" group="index" app="forums" params="$forum"}

{{endforeach}}

</ol>

{{endif}}

</li>

{{endif}}

{{endif}}

{{endforeach}}

{{if settings.club_nodes_in_apps and $clubForums = \IPS\forums\Forum::clubNodes()}}

<li data-categoryID='clubs' class='cForumRow ipsBox ipsSpacer_bottom'>

<h2 class="ipsType_sectionTitle ipsType_reset cForumTitle">

<a href='#' class='ipsPos_right ipsJS_show ipsType_noUnderline cForumToggle' data-action='toggleCategory' data-ipsTooltip title='{lang="toggle_this_category"}'></a>

<a href='{url="app=forums&module=forums&controller=forums&do=clubs" seoTemplate="forums_clubs"}'>{lang="club_node_forums"}</a>

</h2>

{{if \IPS\forums\Forum::getMemberView() === 'grid'}}

<div class='ipsAreaBackground ipsPad' data-role="forums">

<div class='ipsGrid ipsGrid_collapsePhone' data-ipsGrid data-ipsGrid-minItemSize='250' data-ipsGrid-maxItemSize='500' data-ipsGrid-equalHeights='row'>

{{foreach $clubForums as $forum}}

{template="forumGridItem" group="index" app="forums" params="$forum"}

{{endforeach}}

</div>

</div>

{{else}}

<ol class="ipsDataList ipsDataList_large ipsDataList_zebra ipsAreaBackground_reset" data-role="forums">

{{foreach $clubForums as $forum}}

{template="forumRow" group="index" app="forums" params="$forum"}

{{endforeach}}

</ol>

{{endif}}

</li>

{{endif}}

</ol>

</section>

Daniel F

Invision Community Team

This function doesn't exist in IC5 anymore.

Daniel F

Invision Community Team

Changed Status to Not a bug

Adriano Faria

Clients
 

{{if \IPS\forums\Forum::getMemberView() === 'grid'}}

Use instead:

{{if \IPS\Member::loggedIn()->getLayoutValue('forums_forum') === 'grid'}}

Thomas Hop

Clients

Thanks, this fixed the infinite loading issue!