JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 9, 2017 1:33:28 GMT -8
aludium.proboards.com/Hello all, I'm trying to build a custom mini profile and I can see that the custom profile fields come up as {foreach} and then have the exact same code. Is there a way I can specify particular custom fields so that I can make them look different to each other? You can do this with boards and categories so I was wondering if you can also do this with custom profile fields. The end result I'm looking for is for each custom profile field to be an image (different images) that you can then hover over and the value will appear. eg. You hover over an image that looks like a planet and a text box with "Coruscant" pops up because the member has entered that Coruscant is their homeworld. I want this to work exactly the same for every custom mini-profile, but I want the images to be different. If anyone can help me with this, I'd be much appreciative!! Thanks,
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 9, 2017 9:54:26 GMT -8
Yeah you can! It's very similar to how you select individual boards / categories
{if $[user.custom_field.name] == "name here case sensitive"} condition {/if}
so you can do something like:
{if $[user.custom_field.name] == "field"} <div class="special-class"> $[user.custom_field.value] </div> {/if}
Note though that fields do not appear unless they are filled out, so if you made a custom profile field look a specific way that isn't shared by all custom fields, it wouldn't appear if the field remained blank.
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 9, 2017 9:56:26 GMT -8
You're an absolutely star Kami! Many thanks for your help and I shall bear that in mind!
Cheers!
EDIT: I don't suppose you'd know how to make this work in conjunction with the Simple RPG Stats Plugin at all, while I'm here? I've posted on the support thread but no response as yet. I'd really like to be able to do the same with these but they don't even appear as code in the template...? :S
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 9, 2017 10:02:16 GMT -8
Unfortunately hon I've never used that plugin. My recommendation however would be to find out what class name(s) it has. Activate it on your mini profile however it's done, the when you're viewing a page with the MP displaying, right click and select "inspect element" (chrome, if you're on something else you will need to find the equivalent).
This should open up the developers console and you'll be able to see the classes being used, and see if you can target them individually or if they all share a class name.
If they share a class name, the plugin would need to be edited. If they don't, then you can target those classes individually in your style sheet.
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 9, 2017 11:10:38 GMT -8
Okie dokes, I'll try that. Thanks very much for your help Kami, always a pleasure!
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 9, 2017 11:30:09 GMT -8
Okie dokes, I'll try that. Thanks very much for your help Kami, always a pleasure! :) You're welcome! I'd love to know the outcome of that so I can keep it in mind for future inquiries, if you wouldn't mind posting your findings (:
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 9, 2017 12:50:01 GMT -8
Okie dokes, I'll try that. Thanks very much for your help Kami, always a pleasure! You're welcome! I'd love to know the outcome of that so I can keep it in mind for future inquiries, if you wouldn't mind posting your findings (:
No problem at all. As soon as I work it out, if I work it out, you'll be the first to know!
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 12, 2017 4:36:58 GMT -8
You're welcome! I'd love to know the outcome of that so I can keep it in mind for future inquiries, if you wouldn't mind posting your findings (:
No problem at all. As soon as I work it out, if I work it out, you'll be the first to know! Hey Kami, Found out that it's not possible to edit the RPG stats individually - only as a group under a single class tag. I'm having a rethink for doing this now, but your code is working lovely, so thanks for that! Have a good one!
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 14, 2017 3:39:23 GMT -8
Hi Kami , Not sure what I've done wrong, but the above custom profile code you gave me doesn't seem to be triggering. This is my code: {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Member Since"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Message User"}$[user.mini_custom_field.value]{/if}{/foreach} $[user.posts] {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Play By"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Gender"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Age"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Sexuality"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Homeworld"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Creator"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Character Bio"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Plot Tracker"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Communicator"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Strength"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Agility"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Defense"}$[user.mini_custom_field.value]{/if}{/foreach} {foreach $[user.mini_custom_field]}{if $[user.custom_field.name] == "Money"}$[user.mini_custom_field.value]{/if}{/foreach} And this is the page it's displaying on: aludium.proboards.com/thread/69/002-basic-current-timelineI've tried doing it with just a single foreach tag around the whole lot, or separately like I currently have it, and I can't seem to get it to work at all. It's only bringing up the posts information because that one isn't inside custom field tags. I've also made sure that there is something in every custom profile field for this account. Please let me know if there's something obvious I'm doing wrong and being an idiot at. Many thanks,
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 14, 2017 8:53:44 GMT -8
Give me a little bit to look into this, I'm a little swamped with work so it might take a bit!
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 14, 2017 10:30:21 GMT -8
Give me a little bit to look into this, I'm a little swamped with work so it might take a bit!
No problem, Kami. I'm thankful for any help you can give, whenever you can
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 14, 2017 10:55:41 GMT -8
JD - I'm not sure where you got $[user.mini_custom_field]} and $[user.mini_custom_field.value] because that wasn't what I provided. What I provided was $[user.custom_field.name] and so on, not "mini_custom_field". While that is a variable, that isn't what I used for this. If I recall correctly, there's no reason those variables should need a foreach loop around all of them (and it's really not advisable, there's a 25 loop limit per template) but I'm not 100% certain on this. Here's what mine looks like: {foreach $[user.custom_field]} {if $[user.custom_field.name] == "ooc alias"} <span class="$[user.custom_field.content_class]"> <div style="float: left; margin-bottom: 1px;">$[user.custom_field.name]:</div> <div style="float: right; margin-bottom: 1px;">$[user.custom_field.value]</div> <div style="clear: both;"></div> </span> {/if} {if $[user.custom_field.name] == "plotting thread"} <span class="$[user.custom_field.content_class]"> <div style="float: left; margin-bottom: 1px;">$[user.custom_field.name]:</div> <div style="float: right; margin-bottom: 1px;"> <a href="$[user.custom_field.value]">Link</a> </div> <div style="clear: both;"></div> </span> {/if} {/foreach}
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 14, 2017 11:33:38 GMT -8
Wow that's so weird. I could have sworn I copied and pasted. :S Bizarre. Apologies for me being thick. I shall try the new code
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 14, 2017 11:41:44 GMT -8
Let me know how it works out!
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jul 15, 2017 4:47:30 GMT -8
Thanks Kami! I have managed to get it working how I want! Thanks again!
|
|