vipoi
New Member
Posts: 22
inherit
220754
0
May 6, 2021 18:00:56 GMT -8
vipoi
22
April 2015
vipoi
|
Post by vipoi on Sept 24, 2017 23:02:11 GMT -8
Hello. I've been using Brian Ordonez's fabulous Sidebar Redux on a site I'm tinkering on, but I think this is more of a coding issue than a plugin issue as I'm having a js problem... I'm trying to make it so that the user-specific value stored in a specific custom field appears in the sidebar. The Custom Field is called Test for now and the value is going to be text in its Text Field. I'm pretty terrible at coding, does anyone know a solution? Thank you.
|
|
#eb7100
33409
0
1
May 6, 2024 0:49:12 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Sept 25, 2017 10:05:29 GMT -8
Assuming you want to show the custom field values of whichever account you're logged in as your best bet will be to construct the necessary HTML in Themes > Layout Templates > Forum Wrapper, then move it into the sidebar using Javascript. As far as I know that's pretty much the only way to accomplish this.
The only question is whether you need just the value of the custom field or if you need to determine whether or not an entire paragraph/container shows in the sidebar based on the presence of this custom field.
|
|
vipoi
New Member
Posts: 22
inherit
220754
0
May 6, 2021 18:00:56 GMT -8
vipoi
22
April 2015
vipoi
|
Post by vipoi on Sept 25, 2017 14:41:46 GMT -8
Thank you for your reply Brian, and your great plugin. All I would need is the name of the Custom Profile Field and then the value, which is likely to be three words tops. So like: Test: Blah Blah Blah or something. Barring that, just the value of the text. It will be like 20 characters tops. It wouldn't generate its own Sidebar, it'd appear in a pre-existing sidebar with other stuff in it (though if I had to I could make it its own sidebar). So I would need to write the necessary script somewhere into the Forum Wrapper?
|
|
#eb7100
33409
0
1
May 6, 2024 0:49:12 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Sept 25, 2017 15:38:11 GMT -8
Pretty much.
This is what you'd use in the Forum Wrapper. The text in green is your custom field name.
And this is what you'd use in the sidebar as a placeholder for where the custom field name and value are meant to show. The text in green is your custom field name again, but converted to lowercase with no spaces and only alphanumeric characters (a-z, 0-9).
|
|
vipoi
New Member
Posts: 22
inherit
220754
0
May 6, 2021 18:00:56 GMT -8
vipoi
22
April 2015
vipoi
|
Post by vipoi on Sept 25, 2017 19:49:45 GMT -8
Ooo thank you. I wouldn't have gotten that in a million years. It works now when I click on the Profile, it'll show on the sidebar then, but for some reason it doesn't show in the homepage. I tried putting it in the header, footer, or body it just doesn't seem to want to work cept on the Profile page. Hmm...
|
|
#eb7100
33409
0
1
May 6, 2024 0:49:12 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Sept 26, 2017 7:59:21 GMT -8
This is why I wish the power didn't go out when I tried to type this post around 4 PM yesterday. I knew I'd mess it up when I typed it again. Every instance of user should actually be current_user. I swear I got it right the first time I was typing that post. Edited it to correct the code.
|
|
vipoi
New Member
Posts: 22
inherit
220754
0
May 6, 2021 18:00:56 GMT -8
vipoi
22
April 2015
vipoi
|
Post by vipoi on Sept 26, 2017 9:41:05 GMT -8
Holy heck it works!!! Thank you SO much Brian. Also, Splatoon 2 is my jam. #TeamMayo
|
|
#eb7100
33409
0
1
May 6, 2024 0:49:12 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Sept 26, 2017 9:48:51 GMT -8
Holy heck it works!!! Thank you SO much Brian. Also, Splatoon 2 is my jam. #TeamMayo Glad to see someone has some taste. We dominated that Splatfest.
|
|