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

XF 1.2 How does "merge" templates work?

Discussion in 'Styling and Customization Questions' started by RobParker, Aug 27, 2013.

  1. RobParker

    RobParker Well-Known Member

    I've just downloaded an update to a skin and now have some outdated templates as I've previously edited the template.

    It gives me the option to merge the changes but I don't really understand how it works.

    Screen Shot 2013-08-27 at 18.38.50.png

    What does the "deleted" signify? What's been deleted and how do I see if it needs re-adding?

    Are the other items in the blue boxes ones that are in my edited version or in the new updated template?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. RobParker

    RobParker Well-Known Member

    Cheers, I read that but I don't think it answers either of the two questions I asked? (Or it does and I'm just not quite getting it).

    "Blue represents a successful, non-conflicted merge (either from the parent changes or your custom changes)"

    But this doesn't indicated from which source it's come from? I also still don't understand the "deleted" bit. That suggest there was a non-conflicted deletion? What does that actually mean though as if it was a deletion then it must have been in one or the other and hence a conflict, no?
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    Deleted implies the code is no longer present in either version of the template you are merging, meaning its being removed from your version once you click "Merge".
     
  5. RobParker

    RobParker Well-Known Member

    Your sentence doesn't make sense does it?

    If the code isn't present, how can it be "removed"?

    (Sorry for being so dense about this)
     
  6. AndyB

    AndyB Well-Known Member

    Hi Rob,

    I suggest you put all CSS overrides into the EXTRA.css template. That way you don't have to worry about updating CSS templates when you upgrade.
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    There is code that is present in your current version. Its been removed in the new version you are merging into your version, and as such, it is being removed from your version of your template when you click Merge.
     
  8. RobParker

    RobParker Well-Known Member

    Hi Andy,

    We have for the majority. There were just a couple that I made directly in the template to avoid !important.

    I also for example made a chance to page_container to move the notice position so I'd still like to understand this.
     
  9. RobParker

    RobParker Well-Known Member

    Ah thanks. I understand now I think.

    Just to make sure, you're saying the system remembers the original version before I made any changes, the version with my changes and the new version? I don't think I appreciated the "3-way diff" approach so didn't see how it knew something was deleted from the updated version.
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    Yes, there is a template version history that remembers changes.
     
  11. AndyB

    AndyB Well-Known Member

    Hi Rob,

    Curious why you want to avoid the !important code? I never understood why that's sometimes needed in CSS.
     
  12. Jeremy

    Jeremy XenForo Moderator Staff Member

    Steve F and CyberAP like this.
  13. RobParker

    RobParker Well-Known Member

    What Jeremy said :)
     
  14. AndyB

    AndyB Well-Known Member

    Thanks for the link, Jeremy.

    From what I can tell, the main reason to avoid using !important would be to make debugging your CSS easier. However I have not run into this problem yet.
     
  15. RobParker

    RobParker Well-Known Member

    Well for example if its used in a template then modifying it via extra.css isn't possible.
     
  16. AndyB

    AndyB Well-Known Member

    I always add <div class="name_of_class"> or <span class="name_of_class"> in the template and define the class in EXTRA.css.
     

Share This Page