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

Correct way to create template modification

Discussion in 'XenForo Development Discussions' started by TheBigK, Apr 13, 2015.

  1. TheBigK

    TheBigK Well-Known Member

    I'm planning to use a template modification and I've done this:-

    Template: member_view
    Find: <xen:hook name="member_view_tabs_heading" params="{xen:array 'user={$user}'}" />
    Replace: <xen:include template="profilenotes_member_profile_heading">

    Or should it be:

    Replace:
    <xen:include template="profilenotes_member_profile_heading">
    <xen:hook name="member_view_tabs_heading" params="{xen:array 'user={$user}'}" />

    Is there any better / recommended way to do it?
     
    Last edited: Apr 13, 2015
  2. TheBigK

    TheBigK Well-Known Member

    ...and for some out of the world reasons, the above does not work :(

    My template:
    Code:
    <li><a href="{$requestPaths.requestUri}#profilenotes">{xen:phrase profilenotes_member_tab_heading}</a></li>
     
  3. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    You haven't included the '/' for xen:include tag: :p
    Code:
    <xen:include template="profilenotes_member_profile_heading" />
    
    And of-course you have to include what you are replacing if you don't want that part to go away :D
    And for that you don't have include it twice, just use:
    Code:
    $0
    in the Replace With textbox

    so it will be something like this:
    Code:
    <xen:include template="profilenotes_member_profile_heading" />
    $0
    
    :)
     
    TheBigK likes this.
  4. Steve F

    Steve F Well-Known Member

  5. TheBigK

    TheBigK Well-Known Member

    Even with /> , it does not work. This is how it looks right now; but does not work:

    Find: <xen:hook name="member_view_tabs_heading" params="{xen:array 'user={$user}'}" />
    Replace: <xen:include template="profilenotes_member_profile_heading" /> $0
     
  6. TheBigK

    TheBigK Well-Known Member

    Just in case I'm missing anything, here's the screenshot: -

    Screen Shot 2015-04-13 at 10.26.20 am.png

    This thing works absolutely fine if I simply use the replace text as the content of my template:

    Code:
    <li><a href="{$requestPaths.requestUri}#profilenotes">{xen:phrase profilenotes_member_tab_heading}</a></li>
     
  7. TheBigK

    TheBigK Well-Known Member

    DAMN!

    The problem was with 'Style'. I created the template in the master as well as the default style - and then clicked save. -> Nothing happend.

    Clicked : Save again.

    Magic!

    :D
     
  8. Steve F

    Steve F Well-Known Member

    If this is all that is in your template why not simply use it?
    HTML:
    <li><a href="{$requestPaths.requestUri}#profilenotes">{xen:phrase profilenotes_member_tab_heading}</a></li>
    I posted that link above again to hint at looking at how it is already accomplished in the RM. :)
     
  9. TheBigK

    TheBigK Well-Known Member

    Already referred to it. The problem was that I was using a different style. I created the template across all the styles and it began working.
     

Share This Page