Jump to content
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Как в Global Template получить ID форума

Не могу в 4-ке в шаблоне Global Template получить ID форума.

Пробовал все варианты:

$forumid

$forum->_id

$forum->id

Featured Replies

В globalTemplate нету id ни одной сущности. Единственное что там доступно это \IPS\Request::i()

  • Author

Сори не очень разбираюсь в шаблонах.

А что дает IPS\Request::i() ?

Можно через него получить ID форума? Где об этом почитать?

  • Author

Нашел инфу по request

Только не соображу какой параметр мне нужен для получения GET запроса ID или названия форума?

\Request это параметры запроса. Прежде всего нужно составить условие что это является страница форума

 

{{if request.app=='forums' and request.module =='forums' and request.controller =='forums'}
   {\IPS\Request::i()->id}
{{endif}}

  • Author

Что-то у меня данный код просто {request.id} выводит

Используйте expression

 

{expression="request.id"}

  • Author

Хух получилось! Спасибо!

Вот мой код, может кому пригодится:

{{if request.app=='forums' and request.module=='forums' and request.controller=='forums'}}
 {{if request.id == 123}}{УСЛОВИЕ1}
 {{else}}{УСЛОВИЕ2}
 {{endif}}
{{endif}}

Т.о. в подфоруме 123 выводится УСЛОВИЕ1, во всех остальных УСЛОВИЕ2

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.