Jump to content

Hooking into profile blocks creates a loop


Recommended Posts

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

Link to comment
Share on other sites

This is what I get if I hook into the code below

<div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom">

ib75V44.png

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

Link to comment
Share on other sites

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? 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

4 minutes ago, TheJackal84 said:

I just tried that and it still loops

My mistake, i wrote too fast :D instead of typing child i wrote number 

This should work and i just tested it does not loop :) 

#elProfileInfoColumn>div>div::nth-child(3)

 

Link to comment
Share on other sites

5 minutes ago, TAMAN said:

My mistake, i wrote too fast :D 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

VQQShub.png

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

 

Link to comment
Share on other sites

Just now, TheJackal84 said:

that throws it here

VQQShub.png

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...