1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Position of elements above forum list

Discussion in 'Styling and Customization Questions' started by Mr Lucky, Oct 28, 2014.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    Say I have two addons that put a box above the forum list, how would I determine in what order they are?

    Specifically I have @Brogan 's CTA featured threads and Prefix Forum Listing.

    By default the Prefix Forum listing box seems to go above the Featured Threads box.

    Can anyone please explain how to make it the other way round if possible so Featured Threads is first.

    Thanks
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It depends how they are added to the template.

    My add-on uses a template modification and injects it after the /xen:container tag, with an execution order of 10.

    If the other add-on does the same, the execution order will determine which one is at the top and which is at the bottom.

    I'm not familiar with the other add-on so I couldn't tell you how it does what it does.
     
  3. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks Brogan. Is it an easy matter to change the execution order? For example what and where would I change it in you addon so that I can experiment?

    Thanks
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You need to enable debug mode, then click on the template modification and change the order here:

    upload_2014-10-28_19-2-49.png
     
  5. Mr Lucky

    Mr Lucky Well-Known Member

    I'm not sure what you mean by click on template modification

    I am following the instructions here for changing callback execution order.

    I get to the list of Code event listeners for CTA Featured threads. Do I change all of them or what?

    Thanks
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    It's a template modification, not a code event listener.

    upload_2014-10-29_10-56-9.png
     
  7. Mr Lucky

    Mr Lucky Well-Known Member

    Ah I see my mistake - I was just following those instructions which I got when searching for change callback execution.

    Have found template modifications but there are none for the other plugin so I guess it works differently. Changing the order for CTA Featured Threads in forum_view (Add a featured threads block to the forum view) does nothing.

    What I can find for the other plugin that looks most relevant is in Code Event listeners: template_hook: forum_view_pagenav_before

    So does that mean I won't be able to change the order if the plugins are added to the template in different ways?
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    You would need to ask in the thread for that add-on.
     
  9. Mr Lucky

    Mr Lucky Well-Known Member

    No reply there yet.

    I understand your point, but with two addons involved which it seems work in different ways, I thought i would get more help in the general styling forum as neither addon developer (understandably) would be in a position to know about the other one.

    Your addon is positioned via template modification, it seems the other one isn't so maybe somebody with some knowledge of styling and other ways to position elements may be able to help.
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    As I said in my original post:
    Without knowing how the other add-on does it, there's not much more I can say other than move the template edit to earlier in the template.

    Try doing the find on <xen:h1>{$xenOptions.boardTitle}</xen:h1> instead.
     
  11. Mr Lucky

    Mr Lucky Well-Known Member

    Yes, I totally appreciate that

    I'm not quite sure what you mean by that.
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

  13. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks, I'm beginning to understand

    But if it's forum view, not forum list, what would I do the find on? Thanks
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    Any line above the current find code line, which achieves the result you want.

    You need to also take into account things such as notices, ads, etc.
     
    Mr Lucky likes this.
  15. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks - that works now! A bit of trial and error once you know how does the trick.
     

Share This Page