Jump to content

Thomas Hop

Clients
  • Joined

  • Last visited

  1. I already had an inkling that it should be done that way, but thanks for the confirmation :).
  2. Hello all! We are in the process of developing the 5.0.x environment on a test environment, as we want to have everything in good order there first. For this, we will eventually migrate the test environment to the live environment and for this I am trying to figure out where the pages are stored in the DB so that I can export and import them on the live environment when version 5.0.x is on there.
  3. This fixes it, thanks!
  4. I have tried selecting that option, but it seems like that hook target isn't being loaded for me
  5. Hello! I'm not able to find the mobileFooterMenu in the list where you can select all of your hook targets whilst there does exist an element on the mobile website with the att "data-ips-hook='mobileFooterMenu'". How can I still hook into "mobileFooterMenu"?
  6. Thanks @Daniel F, this got it working :). @DawPi At first I had something like the code below there, but this didn't work so I removed it, but forgot the remove $currentUrl. That's why haha. ->setQueryString( 'return', base64_encode( $currentUrl ) );
  7. Hello all! I'm building my own language switcher because i'd like my switcher to be added the mobile user menu. I have got it working, it switches to the language that I click on. But now I have ran into the issue that when you are on a page like "/contact/" you'd still be redirected to the homepage. I have tried a lot and I can't seem to get it working. Can anybody with more experience point me into the right direction? Much appreciated, thanks! /** * @brief UserMenu extension: languageSwitcher */ class languageSwitcher extends MenuExtension { /** * Modify the account menu by adding language switcher items. * * @param string $position Position of the menu (content, settings, logout) * @return array<MenuItem> */ public function mobileMenu( string $position = 'content' ): array { $menuItems = []; if ($position === 'content') { $currentUrl = \IPS\Request::i()->url(); // Get the current page URL // English language switch link $englishUrl = \IPS\Http\Url::internal('app=core&module=system&controller=language&id=1', 'front') ->csrf(); // Add CSRF token $englishLink = new \IPS\Helpers\Menu\Link( $englishUrl, 'English', 'ipsMenu_item' ); $menuItems[] = $englishLink; // Dutch language switch link $dutchUrl = \IPS\Http\Url::internal('app=core&module=system&controller=language&id=2', 'front') ->csrf(); // Add CSRF token $dutchLink = new \IPS\Helpers\Menu\Link( $dutchUrl, 'Dutch', 'ipsMenu_item' ); $menuItems[] = $dutchLink; } return $menuItems; }
  8. I have fixed the issue by adjusting the code in "awardOther" to access $extra['posts']->item()->author() instead of $extra->item()->author(). Is this the optimal way to do it? As I have a feeling it will break again when you update the website.
  9. Yes, but i'm seeing the same error when i'm not in dev- mode.
  10. I was wondering if you guys have had time to respond to my issue above.
  11. @Marc I have updated to the latest beta version and seems the issue still persists. But still when I refresh the page it works correctly and the solution is given. @Esther E. It seems as me updating to 5.0.4 has removed the "helpful" button. But before I wasn't given an exception for pressing the button, it simply didn't work on the first click but on refresh it was given the "helpful" assignment.
  12. Thanks, this fixed the infinite loading issue!
  13.    Thomas Hop reacted to a comment: Undefined function
  14. 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>
  15. 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.
  16. Kind of the same thing happens when I try to mark a comment as "Helpful". It doesn't show on my screen it's marked, but once I refresh my page it gets added.