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, este código es excelente. Quiero hacer un pequeño ajuste y quizás tú sepas… ¿cómo puedo obtener el external_id al final de la URL (es decir, const url = 'http://site.com/${external_id}')? Intenté modificar el código para extraer el external_id del objeto de usuario, pero dice que esa propiedad está indefinida.
Este código está obsoleto, ¿puedes actualizarlo por favor? Intenté modificarlo pero no funcionó.
[Aviso de administrador] Uno o más de sus complementos o componentes de tema necesitan ser actualizados porque son incompatibles con Discourse 3.2.
Puede encontrar más información en la base de conocimientos de Communiteq.
Detalles: [TEMA 1 ‘Default’] Las extensiones de prototipos de funciones han quedado obsoletas, migre de function(){}.property(‘bar’) a computed(‘bar’, function() {}).
Parece que esto es muy similar a otra guía. Al igual que en aquella, las estrategias sugeridas en el mensaje original están extremadamente desactualizadas. Lo mejor de ahora en adelante será integrar la funcionalidad en un componente de tema gestionado por Git, para que la gente no tenga que copiar y pegar código.
Estamos evaluando si podemos crear un Customization > Theme component oficial que cubra ambos casos de uso y actualizaremos ambos temas cuando esté listo.