Let’s say you want to add a link of User’s main profile page on Discourse user profile page and user card, clicking on that link will take user to main (external) website.
The link of main website user profile page will be like:
http://site.com/username
Where username is the Discourse username of that user. (It should be same on both main site and Discourse forum)
Let’s get started!
Add custom CSS
Paste this CSS code in Admin > Customize > CSS/HTML > CSS section:
Dear Arpit, does this approach really update userfield siteLink?
We used it “as is” and siteLink in empty under user/preferences siteLink although it is visible over user card
thx
Any chance this example could get an update? Apparently it will not work, since api.container.lookupFactory is a private API and will break stuff
I asked the same a long time ago. You’d have to write a plugin that exposes external_id - I asked recently if it had become enabled, since they changed a lot of stuff, but haven’t received an answer, so I guess it still requires a plugin…
@techAPJ, this code is great. I want to make one small tweak and perhaps you know… how can I get the external_id at the end of the URL (i.e. const url = 'http://site.com/${external_id}')? I tried changing the code to pull external_id from the user object but it says that property is undefined.
هذا الكود مهمل، هل يمكنك تحديثه من فضلك؟ حاولت تعديله ولكنه لم ينجح.
[ملاحظة المسؤول] يحتاج واحد أو أكثر من المكونات الإضافية أو مكونات السمة الخاصة بك إلى التحديث لأنه غير متوافق مع Discourse 3.2.
يمكن العثور على مزيد من المعلومات في قاعدة معارف Communiteq.
التفاصيل: [السمة 1 ‘الافتراضي’] تم إهمال امتدادات نموذج الوظيفة، يرجى الترحيل من function(){}.property(‘bar’) إلى computed(‘bar’, function() {}).
يبدو أن هذا مشابه جدًا لدليل آخر. كما هو الحال مع ذلك، فإن الاستراتيجيات المقترحة في OP قديمة جدًا. أفضل شيء للمضي قدمًا هو بناء الوظيفة في مكون سمة مُدار بواسطة git، حتى لا يحتاج الأشخاص إلى نسخ/لصق التعليمات البرمجية.
نحن نبحث فيما إذا كان بإمكاننا إنشاء Theme component رسمي لتغطية كلتا الحالتين، وسنقوم بتحديث كلا الموضوعين عند جهوزيتهما.