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

XF 1.5 Sorting out outdated templates...

Discussion in 'Installation, Upgrade, and Import Support' started by Gladius, Sep 5, 2015.

  1. Gladius

    Gladius Well-Known Member

    Are there any guides for sorting out outdated templates post-upgrading? I couldn't find anything in help and the inbuilt XF functions are completely unintuitive and without any help or legends.

    As it is, I have no clue what I'm looking at via "View Template Modifications" (whose? mine? the upgrade's?) vs. "View Custom Changes" (which I assume shows mine, but again I'm not sure what the red and green blocks in that view signify -- are these only the old changes, or in light of the upgraded template or what...).
     
    Last edited: Sep 5, 2015
  2. Amaury

    Amaury Well-Known Member

    If the automatic merging function partially fails, then you need to manually merge the changes. Areas highlighted blue mean there was no conflict and the automatic merger worked, while areas highlighted yellow mean there was a conflict and you have three options:
    1. Use XenForo's code
    2. Use your code
    3. Use a combination of both

    For example, on our KH-Flare 2014 style, trophies were commented out everywhere, so I had to fix that in the merger by using XenForo's code for the new if conditional added because of the new enable/disable option for trophies and re-adding my comment out code.

    If you can't even access the manual merging page, you'll need to revert the template and re-apply your changes.
     
  3. Gladius

    Gladius Well-Known Member

    I haven't actually tried using the automatic merger yet because I'd first like to manually compare the old vs. the new template but I'm not even sure how to achieve that, if even possible. We've got some changes around the avatar bit in message_user_info but I don't remember exactly what any more so I'd like to check first before doing anything automatic. I haven't managed to figure out XF's system yet on how to do that, unfortunately.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    To manually compare you will need to take a copy of the edited template and save it.

    Revert the template, take a copy of the default code and save it, or use the code from a default, unedited style.

    Use a program such as Notepad++ to do a comparison between the two.
     
  5. Gladius

    Gladius Well-Known Member

    o_O I'd write that you've gotta be kidding me, but I know that you aren't... where's a jawdrop smiley when you need one.

    What am I missing here? I read years back that XF's system was supposed to be miles better than vB's, but when I can't even compare templates side by side inside the software, this is like going back to the stone age. :confused:
     
  6. Gladius

    Gladius Well-Known Member

    Can someone explain to me exactly what I'm looking at on the template edit page, specifically in:
    • "View Template Modifications" (whose? mine? the upgrade's? which version?)
    and
    • "View Custom Changes" (which I assume shows mine, but again I'm not sure what the red and green blocks in that view signify -- are these only the old changes, or in light of the upgraded template or what...).
    I should be able to work with that if I can only figure out what's what.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    You said you wanted to compare manually.

    The built in compare and auto merge functionality has already been explained to you by Amaury.

    XF 1.2 - Template Merging and History
     
  8. Gladius

    Gladius Well-Known Member

    Amaury was talking about the auto-merger, I'm writing about all the options except the auto-merger...
     
  9. Mike

    Mike XenForo Developer Staff Member

    That's referring to the template modification system used by add-ons.

    This compares your version of the template against the default version (as it stands now). Red would be the value in the default and green the value in yours. Red is a delete, green is an add. When you change something, you are effectively deleting the old version and replacing it with the new version.
     
  10. Gladius

    Gladius Well-Known Member

    Can you expand on that a bit? If I look at the outdated template in question using the "View Template Modifications", I see only a single line added (green). Does that mean that that is the only change in the template since the previous version, that is, the only change that effectively needs to be applied to bring the template up to date and retaining previous modifications?

    Ah, that's a bit clearer now. However, with this system, I don't think that I can tell what's been added vs. what's only been changed, can I? Not without commenting every change previously, anyway... because if I understand you correctly, the old code and any altered or new will just show in a red/green block together and there's no way to distinguish between an addition vs. a change?
     
  11. Mike

    Mike XenForo Developer Staff Member

    It's referring to the template modifications system, so it's showing what changes are being programmatically added to the template via template modifications (likely from add-ons). This is not related to what you're asking about here.

    It's a comparison between what is the current the default and your current (customized) version, so if there are parent changes you haven't incorporated, then they will show as differences. This isn't really designed for comparing an outdated template.

    I'm not really sure what you're specifically calling an "addition" vs a "change". If you've added a line, it would show up as a green line only. However, if there are lines that have differences, they will show up as the old version being removed (red) and the new version being added (green). If you're comparing using an outdated version of a template, this would lead to your custom version showing green values for older lines (because they appear to be a change that you've made).

    The system to deal with outdated templates is likely the best way to track things, though it doesn't explicitly expose what's from the old default to the new default and the old default to your custom version. This system uses a three-way merge to determine areas that have only changed in one of the two comparisons and incorporates those changes automatically, which should lead to more accurate merges and (ideally) fewer conflicts to resolve (which only happens when both versions have changed the same line compared to the old default).
     
  12. Gladius

    Gladius Well-Known Member

    Yea, this is the problematic bit for me. I'm not a coder, so in vB I had a bit more in terms of crutches that I could rely on than in XF.

    Thanks Mike, makes more sense to me now and I expect I'll get the hang of it with some more practice. :D
     

Share This Page