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

Choose which template hook to put it in.

Discussion in 'XenForo Development Discussions' started by Matthew Hawley, Jul 30, 2013.

  1. Matthew Hawley

    Matthew Hawley Well-Known Member

    So on this addon http://xenforo.com/community/resources/ventrillo-viewer.2136/ (and the others), I want users to have the option of where they want to put the server block via a drop down list in the options.


    Okay so on here http://www.gametracker.com/server_info/ you can see the different block types. If a user chooses Ad_above_top_breadcrumb, Ad_below_top_breadcrumb, Ad_above_content, Ad_below_content, or Ad_below_bottom_content, then i want the block to be horizontal. If a user chooses Ad_sidebar_top, Ad_sidebar_below_vistor_panel, or Ad_sidebar_bottom, then I want the block to be vertical.

    How can i achieve this?
  2. Nobita.Kun

    Nobita.Kun Well-Known Member

    You must create new option 'Select Menu': (ACP) ..
    Data pataner:
    Ad_above_top_breadcrumb = replace_new_name_0
    Ad_below_top_breadcrumb = replace_new_name_1
    In code PHP:
    You must create new template_hook
    0xym0r0n likes this.
  3. Matthew Hawley

    Matthew Hawley Well-Known Member

    Why do i want to do that? I already know which template I want to use.
  4. Nobita.Kun

    Nobita.Kun Well-Known Member

    Sorry I didn't read all your request.
    If you want to make an option allow users can select so You need make an custom field or create new column then save position :)
  5. Matthew Hawley

    Matthew Hawley Well-Known Member

    No no no. I want it to be in the options. I don't want every member to choose where it's displayed. Only the admins.
  6. Nobita.Kun

    Nobita.Kun Well-Known Member

    :confused: So please read previous my replied
  7. Matthew Hawley

    Matthew Hawley Well-Known Member

    What do you mean by create a new column
  8. Nobita.Kun

    Nobita.Kun Well-Known Member

    This is you must to do
  9. 0xym0r0n

    0xym0r0n Well-Known Member

    This may not be the proper way but if you create an option in the admcp *there are tutorials on how to create options in the admincp*

    Here is an example from one add-on I made to show prefixes
    <xen:if is="{$xenOptions.showaPrefix} == 1">

    SO in your version of the application you would add code to each of those ad areas that checks to see if that option has been checked off in the admincp.
    ad_1 template is code --- if is= option.location1
    ad_2 template is code --- if is= option.location2
    ad_3 template is code --- if is= option.location3

    I feel like there's a more efficient way to do this in your case. My case is a simple 1 page on/off type thing...

    There is likely a more proper way to do it and I'm pretty sure that's what nobita was trying to explain with the hooks :)

Share This Page