I am working on a plugin that has to render a notice to some specific users in the top area of the website where notices show up. The plugin outlet that I am trying to override is: {{plugin-outlet name="top-notices" tagName="" args=(hash currentPath=router._router.currentPath)}}
I am able to get a static version of the connector to work. I created the following file at this path: plugins/discourse-user-throttle/assets/javascripts/discourse/templates/connectors/top-notices/throttle_info.hbs
This line is working file. But the username does not show
{{{user.username}}}
The issue I am facing is that the {{{user.username}}} doesn’t username. How can that be done?
مرحباً، هل هناك أي إرشادات حول كيفية رؤية خصائص currentUser؟ لا يبدو أنني أستطيع معرفة كيفية أو مكان تسجيل/عرض ذلك. أريد أن أكون قادرًا على الوصول إلى اسم currentUser وعرضه على صفحتي.
إذا كنت تقصد كيفية تسجيل البيانات داخل قالب، يمكنك استخدام {{log data_here}} ويجب أن يظهر هذا في وحدة تحكم المتصفح.
يمكنك أيضًا استخدام واجهة برمجة التطبيقات (API): api.getCurrentUser().
على سبيل المثال، في قسم <html><head> الخاص بالمظهر/المكون الخاص بك: