how to add template block where I want it
[Plugin] MoreRecyclingBins »

Takato

  • Posts: 2
how to add template block where I want it
« on May 16th, 2016, 08:39 AM »
hello, I was wondering I've made a plugin to show some info and I can't seem to get it to show in the spot where I want it.
I want it under the first block under the date on all pages.


but I can only get it to show above that or farther down and only on the index page, any other page it don't show at all.

I have feeling I'm it's just I don't know the right hook point and template function to use or something I'm not sure.

any help?

CerealGuy

  • Posts: 343
Re: how to add template block where I want it
« Reply #2, on May 20th, 2016, 01:19 AM »
You can use mods.xml for this type of stuff.
I did something similiar in my InviteMods plugin. See here:
https://github.com/C3realGuy/InviteMod/blob/master/invitemod/mods.xml

That's the interesting stuff:
Code: [Select]
<file name="Profile.template.php">
<operation>
<search position="after"><dd>' . $context['member']['last_login'] . '</dd>' : '', '</search>
<add><dt>'.$txt['im_pa_invited_by'].'</dt>
<dd>'.$context['invited_href'].'</dd>
</add>
</operation>
</file>

Another (but maybe not recommendable way) is to use javascript and client side dom manipulation.

[Plugin] MoreRecyclingBins »