How patch two file?

  • Is there any way that append to template? Or no I should edit footer?
    Because after I change footer when I want to install other plugins I get problem.

    You can only append things to template variables, but footer is a template, not a variable.

  • You should use a templatepatch. Just insert the following at a place that matches your requirements:

    Code
    {include file='FootADS'}

    MfG Markus Zhang (aka RouL)

  • What you say is good and exit way.
    But I read in Technical documentation we can have custom function in template class can help me and is it possible?

    You should use a templatepatch. Just insert the following at a place that matches your requirements:

    Code
    {include file='FootADS'}
  • What I want is a function or template plugin
    We have footer template

    HTML
    <div id="footer">
    <p class="copyright">{lang}wbb.global.copyright{/lang}</p>
    </div>
    </div>


    this TPL1

    HTML
    <div id="ads">{@$ads}</div>


    Now we code new function by the name addStart('template that we want to add(TPL1)', 'template that TPL1 added at start of it' );
    when we run this function like blow

    PHP
    WCF::getTPL()->addStart('TPL1','footer');


    in all page we get code like blow

    HTML
    <div id="ads">{@$ads}</div>
    <div id="footer">
    <p class="copyright">{lang}wbb.global.copyright{/lang}</p>
    </div>
    </div>


    I think we can do it by using Expanding the template system
    we can have one other for addEnd();.


    This function help us that we do not want to patch template.

  • Hamed has the problem that he has 2 plugins that need to include something in the footer. After the first patch, the second won't work anymore.


    Hamed: Could you please show us both template patches?

  • My Problem Solved in install But I get other problem in uninstall
    I install both of my plugin and Google Analytics (Footscript) and want to uninstall my plugin test.two.in.one.2
    and I get:

    Quote

    The patch that this package is trying to remove has failed because its target file has been externally amended. Therefore this package cannot be removed. Please click the "Cancel package-removal" button.
    error message: Can't find an appropriate location for applying this hunk.
    error code: 20015
    affected template: C:\xampp\htdocs\wcf/../templates/footer.tpl

    My problem in install solved because I use one other include for ducklogo but if I use patch it code in ducklogo I get problem again.