Forum Discussion
Hi bhupen - The method VarunLuthra mentioned is the way to go, I just made a few tweaks to it, it should work. Please check and let me know if you have any concerns.
<script> $(".thread-list .lia-list-row .messageAuthorColumn").each(function(){ var getRole = $(this).find('.lia-user-rank-icon-left').attr('title'); if(getRole == "PlayStation MVP" || getRole =="Administrator"){ $(this).find('.lia-user-rank-icon-left').show(); }else { $(this).find('.lia-user-rank-icon-left').hide(); } }); </script>
Thanks VarunGrazitti but Iam not sure what iam missing because nothing is working for me. I have followed the following steps but iam not able to make the changes. Please see the steps I followed and correct me If Iam doing anythig wrong:
Step One:
Put the folowing css on skin and enable the all icon
.messageAuthorColumn .UserName.lia-user-name img.lia-user-rank-icon-left { display: block; margin-left: -81px !important; }
aded a Digitalplatforms role in backend.
Step 2:
Put the following code in header section "Page Head Content" and "Page Header". I tried to put code on both section at a time because its not working in any place. First I put the code in "Page Head Content" and later on "Page Header".
Step 3:
Paste the following script on "Page Head content"
-> script is about to show the icon on only on "DigitalPlatforms Support" or - "Administrator" role. But its not working at front end. Suggest me where to put i this script so that it starts working.
<script> $(".thread-list .lia-list-row .messageAuthorColumn").each(function(){ var getRole = $(this).find('.lia-user-rank-icon-left').attr('**bleep**le'); if(getRole == "Digital Platform" || getRole =="Administrator"){ $(this).find('.lia-user-rank-icon-left').show(); }else { $(this).find('.lia-user-rank-icon-left').hide(); } }); </script>
Also I put the icon directly on img tag below script. its showing directly on front end
<img class="lia-user-rank-icon-left" title="DigitalPlatforms Support" alt="DigitalPlatforms Support" id="display_9" src="http://stage.community.us.playstation.com/html/**bleep**ets/true.png" >
<img class="lia-user-rank-icon-left" title="Administrator" alt="Administrator" id="display_7" src="http://stage.community.us.playstation.com/html/**bleep**ets/true.png" >
Please suggest me right step to accomplish this task:
Right now All icon are enable at front end. Although I want only show icon on the role of "DigitalPlatforms Support" and "Administrator".
Thanks
- VarunGrazitti11 years agoBoss
bhupen - you need to add following script to your header:
<@liaAddScript> (function( $ ) { $(document).ready(function(){ $(".thread-list .lia-list-row .messageAuthorColumn").each(function(){ var getRole = $(this).find('.lia-user-rank-icon-left').attr('title'); if(getRole == "PlayStation MVP" || getRole =="Administrator"){ $(this).find('.lia-user-rank-icon-left').show(); }else { $(this).find('.lia-user-rank-icon-left').hide(); } }); }); })(LITHIUM.jQuery); </@liaAddScript>
- bhupen11 years agoAdvisor
VarunGrazitti thanks mate for help. I Can see now no icon are visible in front end but the issue is now I can't see the icon on "Administrator" and "Digital platform" role as well. Can you please suggest me the exact steps to put the code on right area to make it working. Please see the above trail I followed to put the code. Some how icon are not showing in front end but I can't see in desired role as well.
Please suggest me the right steps to accomplish it.
Really help is appreciated.
Thnaks
- VarunGrazitti11 years agoBossI checked my code here http://community.us.playstation.com/t5/PlayStation-General/bd-p/10031 in firebug, and it worked perfectly, did you add my code as it is or made any changes. It shouldn't be a difficult task any more as you're just left to add the code.
lmk what steps are you following, must be missing something. - VarunGrazitti11 years agoBoss
bhupen - Got you, just one change and it will work. No changes in JS are required.
The CSS change you made, remove the display block,
.messageAuthorColumn .UserName.lia-user-name img.lia-user-rank-icon-left {
display: block;
margin-left: -81px !important;
}
Please mark the post Accept as a solution if it answers your question. Kudos for the helpful post are appreciated.
- bhupen11 years agoAdvisor
VarunGrazitti Its hard luck for me. Not workin in jquery do you have any idea how can I do it using FTL.
Following are the jquery code How can I do the same way in FTL:
<script>
$(".thread-list .lia-list-row .messageAuthorColumn").each(function(){
var getRole = $(this).find('.lia-user-rank-icon-left').attr('title');
if(getRole != "DigitalPlatforms" || getRole !="Administrator"){
$(this).find('.lia-user-rank-left-icon').hide();
}
});
</script>Regards
- VarunGrazitti11 years agoBossWhere are you using the JS? I guess the issue is not in the code, either You don't have the Role "DigitalPlatforms" on stage or there are no posts made by these 2 roles on the page where you are checking for the posts. Try changing the name of the getRole variable to the ones which are present on 10031 board. LMK, it should work. I checked your production community, and I see a role "Cannon Fodder", "First Son" etc there, try using these instead of DigitalPlatforms to see if it works.
- bhupen11 years agoAdvisor
@graziti Iam puting the js on "Page Head Content" and also changed the value of getRole as well. its not working for me.
- bhupen11 years agoAdvisor
VarunGrazitti Tyson VarunLuthra
Thank you guyz for help. Some how I manged it and resolved.
Thanks you so much.
Cheers!
- VarunGrazitti11 years agoBoss
Good to hear.
Related Content
- 11 months ago
- 2 years ago
- 2 years ago
- 2 years ago