inherit
263254
0
Jan 9, 2021 15:37:53 GMT -8
vet4truth
4
January 2021
vet4truth
|
Post by vet4truth on Jan 8, 2021 7:10:32 GMT -8
Forum URL: deplorablenation.boards.netI know the question of getting MeWe connected has been addressed in another thread, however, my question is of a different nature. Is there a way to just get the option of adding a MeWe account to a members profile similar to how Facebook, Twitter, LinkedIn, etc are listed? I am not trying to access any data, just want to provide my profile link. I see where I can add custom fields, but I want it to list under social links and not on the main profile page. Thanks!!
|
|
#e61919
Support Staff
224482
0
1
Nov 22, 2024 17:59:24 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,527
August 2015
socalso
|
Post by Scott on Jan 8, 2021 9:56:03 GMT -8
vet4truth, I'm transferring this thread to the Coding Help board as I believe maybe a script can help you achieve this.
|
|
inherit
251558
0
May 31, 2024 7:56:34 GMT -8
Liam
33
December 2017
chasesupply
|
Post by Liam on Jan 8, 2021 11:13:11 GMT -8
Hi vet4truth We can achieve this using custom profile fields and a little script in your global header & footer. The only thing to note is that you will have to fill in the field on your Personal tab, not the Social tab. First, create a custom profile field called 'MeWe Profile' and set it up how you want it. Second, paste the following script into the bottom of your global footer at Admin > Structure > Headers & Footers > Global Header & Footer <script> document.addEventListener('DOMContentLoaded', () => { const route = proboards.data('route').name; if (route !== 'user') { return; } const meWeClass = '.custom-field-meweprofile'; const socialContainerClass = '.social.networks';
const meWeContainer = document.querySelector(meWeClass); const socialContainer = document.querySelector(socialContainerClass);
const meWeLink = meWeContainer.children[1].children[0]; meWeLink.innerHTML = 'MeWe';
socialContainer.append(meWeLink); meWeContainer.style.display = 'none'; }); </script>
Where the script goes:Custom Profile Field Example:
|
|
inherit
263254
0
Jan 9, 2021 15:37:53 GMT -8
vet4truth
4
January 2021
vet4truth
|
Post by vet4truth on Jan 8, 2021 11:48:54 GMT -8
Thanks for the reply Liam. So I followed your steps and it still doesn't show under the Social tab, but under the Personal tab of the profile.
Suggestions?
|
|
inherit
251558
0
May 31, 2024 7:56:34 GMT -8
Liam
33
December 2017
chasesupply
|
Post by Liam on Jan 8, 2021 11:57:01 GMT -8
No worries That code won't put the text box onto the Social tab, but it will show the link to your WeMe profile on the profile page of the member under the Social Networks heading. Let me take another look at the code, I'll see if I can get the text box onto the Social tab for you.
|
|
inherit
263254
0
Jan 9, 2021 15:37:53 GMT -8
vet4truth
4
January 2021
vet4truth
|
Post by vet4truth on Jan 8, 2021 12:01:33 GMT -8
Thanks. I was just thinking folks might look for it under the Social tab in their profile before they would look under the personal tab for it.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jan 8, 2021 12:24:26 GMT -8
Liam you don't need a script for this, you can just break down the custom fields templates and arrange them on the summary page. {foreach $[user.custom_field]} {if $[user.custom_field.name] == "MeWe"} <span><strong>$[user.custom_field.name]:</strong> $[user.custom_field.value]</span> {/if} {/foreach} Place wherever you want this field to display on the summary tab. You would 100% need to use javascript to get this field in the Socials tab, but in theory you could also use this www.proboards.com/library/plugins/item/726 or update / create a similar script to put it in its own tab. Not necessarily the most elegant of solutions though.
|
|
inherit
251558
0
May 31, 2024 7:56:34 GMT -8
Liam
33
December 2017
chasesupply
|
Post by Liam on Jan 8, 2021 12:38:23 GMT -8
That's true, though to maintain the same style as the rest of the links under Social Networks it would be more like this: EDIT: I misunderstood what your post was about. Ignore my code {foreach $[user.custom_field]} {if $[user.custom_field.name] == 'MeWe Profile' } <a target="_blank" href="$[user.custom_field.value]" rel="nofollow">MeWe</a> {/if} {/foreach} I'm still looking at getting it onto the Social tab in an elegant way.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jan 8, 2021 12:44:45 GMT -8
That's true, though to maintain the same style as the rest of the links under Social Networks it would be more like this: EDIT: I misunderstood what your post was about. Ignore my code {foreach $[user.custom_field]} {if $[user.custom_field.name] == 'MeWe Profile' } <a target="_blank" href="$[user.custom_field.value]" rel="nofollow">MeWe</a> {/if} {/foreach} I'm still looking at getting it onto the Social tab in an elegant way. No you're right that's the best way to maintain styling :P But I would use a double quotation in custom field name -- it's temperamental so mix-matching leads to malfunctioning code.
|
|
inherit
251558
0
May 31, 2024 7:56:34 GMT -8
Liam
33
December 2017
chasesupply
|
Post by Liam on Jan 8, 2021 14:20:39 GMT -8
Oh okay, I'll use double quotes for that from now on. Thanks! I think it comes from using single quotes everywhere in JS but double quotes in HTML and I did it without a second thought.
I looked at moving the field into the Social tab but I would have to programmatically submit the save button on the Personal tab and I couldn't get it to work at all. Maybe someone else can put something together? For now you might just have to let users know that they need to go to the Personal tab if they want to set their MeWe link.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jan 8, 2021 14:50:34 GMT -8
Oh okay, I'll use double quotes for that from now on. Thanks! I think it comes from using single quotes everywhere in JS but double quotes in HTML and I did it without a second thought. I looked at moving the field into the Social tab but I would have to programmatically submit the save button on the Personal tab and I couldn't get it to work at all. Maybe someone else can put something together? For now you might just have to let users know that they need to go to the Personal tab if they want to set their MeWe link. It might be possible, in theory. There's a plugin that puts all custom profile fields in a *new* tab, that might be a clue? I don't write JS so just spitballing here. www.proboards.com/library/plugins/item/152
|
|