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

Hook for Extra.css?

Discussion in 'Closed Suggestions' started by BamaStangGuy, Apr 7, 2013.

  1. BamaStangGuy

    BamaStangGuy Well-Known Member

    Basically, I want to have a constant in Extra.css so that I can use TMS to add my own CSS to my forum without having to worry about it being overwritten in a style upgrade.

    My understanding with the way that 3rd party styles work when upgrading them is that all templates are overwritten regardless of changes or not.

    A way to add css to extra.css without worrying about style upgrades would be nice.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    EXTRA.css is not overwritten.
  3. BamaStangGuy

    BamaStangGuy Well-Known Member

    That solves that problem. Thanks.
    Shelley likes this.
  4. Steve F

    Steve F Well-Known Member

    During a style upgrade the EXTRA.css does get overwritten, which is what Bama is saying he wants to remedy so his additions to the EXTRA.css are not overwritten when he upgrades said style.

    What I am starting to do is use a custom css template specific to the style and leave the EXTRA.css for the end user to fill in with their edits. That way they just need a backup copy of the EXTRA.css template and not have to worry about comparing changes for upgrades.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, I can see now he meant for custom styles.

    However, all you need to do is create your own custom template and include it in EXTRA.css.
    Steve F likes this.
  6. BamaStangGuy

    BamaStangGuy Well-Known Member

    Which will still be overwritten and need to be added back after each update to the style. This becomes a lot of work over time when you have 14+ forums to upgrade. A simple hook in extra.css would solve this problem.
  7. Steve F

    Steve F Well-Known Member

    You can call your own template from the EXTRA.css as Brogan said.

    <xen:include template="MyCSS.css" />
    Put your changes in the new template and away you go.
  8. BamaStangGuy

    BamaStangGuy Well-Known Member

    That one line that you include is still erased with each update though, correct? So it would still have to be added back with each style overwrite.

    I am not suggesting this as a theme designer but as someone who uses many different themes across different sites and wants the upgrade process to be as easy as possible.
  9. Steve F

    Steve F Well-Known Member

    Your correct but it would be much easier to add that one line back then compare each template on each site.
  10. Russ

    Russ Well-Known Member

    Could always use child styles as well, install the normal template you'd use, then create a child style underneath it using all your customizations.

    On upgrades, when you get the new version of the master style, it will show you(if any) outdated templates your child has.
  11. Mike

    Mike XenForo Developer Staff Member

    I should note that in 1.2, our template modifications will work in extra.css. You don't need a particular hook - you can simply use the regex to either match the very beginning or very end. So considering this moot.
    BamaStangGuy likes this.

Share This Page