TheJackal84 Posted July 1, 2017 Posted July 1, 2017 When I try to put say a block in the members profile, There is only 1 way I found to do it and that's to hook into #elProfileInfoColumn > div.ipsPad And to set it to show at the top or bottom etc, But I really want to place the hook say above the followers or the about user block, the problem is they all use the same divisions like shown below, <div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom"> So if I try to place the hook around one of them divisions it will just loop the hook and place it under/over all 3 blocks, Even adding a class to it, adds the class to all divisions, The only way I found to do it is to replace the whole code (what I hate doing), Is there anyway around this or is there a way for IPS to add separate classes to them like <div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom followers_block"> <div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom aboutuser_block"> just so we can work around them better
TheJackal84 Posted July 1, 2017 Author Posted July 1, 2017 8 minutes ago, newbie LAC said: Legend I will give it a shot, Thanks Edit -- it's not the css, I want to add my own block to it to show under certain blocks
TAMAN Posted July 1, 2017 Posted July 1, 2017 Quote The theme hook editor allows you to easily hook into templates using CSS selectors. You can do something like #elProfileInfoColumn>div>div:nth-number(3)
TheJackal84 Posted July 1, 2017 Author Posted July 1, 2017 This is what I get if I hook into the code below <div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom"> It's because all the blocks use the same divisions so it hooks into all 3 2 minutes ago, TAMAN said: You can do something like #elProfileInfoColumn>div>div:nth-number(3) I don't want to touch the css that has nothing to do with it, Its a template I want to add to it
TAMAN Posted July 1, 2017 Posted July 1, 2017 9 minutes ago, TheJackal84 said: I don't want to touch the css that has nothing to do with it, Its a template I want to add to it You can hook using any css selectors If you hook and target by this selectors in profile <div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom"> which is basicly are blocks repeated with same classes then of course your template will be repeated Hook into the profile template by this selector #elProfileInfoColumn>div>div:nth-number(3) it will target the followers block in profile templates isnt that what you asking for?
TheJackal84 Posted July 1, 2017 Author Posted July 1, 2017 8 minutes ago, TAMAN said: You can hook using any css selectors If you hook and target by this selectors in profile <div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom"> which is basicly are blocks repeated with same classes then of course your template will be repeated Hook into the profile template by this selector #elProfileInfoColumn>div>div:nth-number(3) it will target the followers block in profiles templates isnt that what you asking for? I just tried that and it still loops -- EDIT -- Perfect 4.2 must be different #elProfileInfoColumn>div:nth-number(3) but it works, Thanks I wanted to do this for ages, Now I can Edit again lol Didn't work like that only showed at bottom still
TAMAN Posted July 1, 2017 Posted July 1, 2017 4 minutes ago, TheJackal84 said: I just tried that and it still loops My mistake, i wrote too fast instead of typing child i wrote number This should work and i just tested it does not loop #elProfileInfoColumn>div>div::nth-child(3)
TheJackal84 Posted July 1, 2017 Author Posted July 1, 2017 5 minutes ago, TAMAN said: My mistake, i wrote too fast instead of typing child i wrote number This should work and i just tested it does not loop #elProfileInfoColumn>div>div::nth-child(3) that throws it here Edit -- I AM STILL ASLEEP ITS EARLY DON'T BLAME ME LOL-- Thanks it worked your a star, I think I am going to have a cup of tea before I do anything else as my head is all over the place
TAMAN Posted July 1, 2017 Posted July 1, 2017 Just now, TheJackal84 said: that throws it here Its up to you now where you want to show your template change the child number and your hook setting before or after or inside the child btw i just checked the followers block in profile has this id elFollowers why dont you just target with that? #elProfileInfoColumn>div>div#elFollowers
TheJackal84 Posted July 1, 2017 Author Posted July 1, 2017 Just now, TAMAN said: Its up to you now where you want to show your template change the child number and your hook setting before or after or inside the child btw i just checked the followers block in profile has this id elFollowers why dont you just target with that? #elProfileInfoColumn>div>div#elFollowers Thanks it was my mistake it did work, I am not fully awake yet and forgot I was putting it inside and not above/below, I didn't actually know that we could use them codes in the selectors I thought it was just the ones in the select element bit, but now I know we can do it this way its opened more opportunities for me with my other plugins, Thanks again
Recommended Posts
Archived
This topic is now archived and is closed to further replies.