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

XF 1.5 Dueling addons and child style modifications

Discussion in 'Styling and Customization Questions' started by TheLaw, Dec 29, 2015.

  1. TheLaw

    TheLaw Well-Known Member

    Two part question:

    (1) I look at template modifications using the "view modifications" link and they appear different than the template I'm looking at and there is no red/green indication for delete/add changes. The template mod is just substituted as if it were part of the template. So I realize that I'm working on a style that is actually a child style of the one I'm editing. But when I try to edit the template, let's say navigation, the template being shown is NOT the one I'm editing. It's actually the navigation.css version of the *parent* template. OK... so how do I make a template modification to the parent template using the modification system for find/replace rather than physically editing the parent template which is part of the framework?

    (2) I've got a couple of conflicts that exist between addons. I'd like for my modifications to take priority over others that "got there first." What do you do when this happens? So far I've been able to turn off some of these individual modifications in these other addons to get what I need done. Is there a suggested way to handle such conflicts?
    Last edited: Dec 29, 2015
  2. TheLaw

    TheLaw Well-Known Member

    Note - I've noticed that xen:if will not work on CSS templates when using variables such boolean queries regarding a template, e.g. if is "home_page" template then use this css code otherwise use another. This is because the variable is probably not loaded at that time and can only be accessed on actual template pages. OK... so my guess is that you need to create two CSS templates and call different ones in the main template, e.g. in home_page have a call to use the alternative CSS template. So the question remains - how do you call a CSS template to use that is actually in a parent template versus the child? So when I load my home page template, how can I specify to use the alternative parent CSS template like navigation2.css? Right now I see:

    <xen:edithint template="navigation.css" />

    and I assume that this is the call to load the appropriate css template.
  3. HWS

    HWS Well-Known Member

    If you create your own style you really should update the templates directly and not use template modifications at all.

    If you empty all navigation templates in your custom styles any modifications of add-ons won't be applied, because they would not be able to find the hook they use.

    In CSS templates "xen:if" cannot be used. You have to provide different css templates and call the if/else in the parent template. Or use clever css selectors.

    This call for a css template is NOT "xen:edithint" but "xen:include". edithint does not have any power when the template is called, it only hints the ACP template editor to show the template together with it's parent template.

    There really should be a template developer manual anywhere here....
  4. TheLaw

    TheLaw Well-Known Member

    Thanks very much for the explanation, especially about what that code actually does (which is the first line of the navigation template)... Yes, understanding how all of this works can be a real investment in time here although once becoming familiar, there are some good explanations I've found from Kier, @Brogan (nice graphics Bro! :D ) and @Chris D and the above from @cclaerhout - although it is a bit scattered.

    What I'm trying to do is hide the subnavigation on the home page (which is using a template from an addon which I have identified.) The challenge in doing so is that it's just a matter of removing the height property from the following CSS in navigation.css

    #navigation .pageContent
    { height: 95px; position: relative; }

    The problem here is twofold. First, it involves modifying a css property on a specific template, let's call it my_home_page. Searching the templates, the only one that made sense which called the navigation.css file was navigation. If the above is only a hint, then I guess what I need to do is:
    • create a second css file, e.g. navigation_css_home.css which is exactly the same save only for the height variable removed ( height: {xen:calc '@headerTabHeight * 2 + 2'}px; )
    • locate the place where navigation.css is called and modify it load navigation_css_home.css if the page template is my_home_page
    If I can get this far I'd be happy. I'll worry about the other template variable conflicts separately.

    BTW - I used template modifications because some things seemed best not specifically part of the template, such as the addon I'm going upload here which is breathtakingly simple yet everyone seems to use CSS to hide tabs (and create other problems you don't realize until later, lol.) Thanks very much for your assistance and explanations in climbing quickly up the learning curve. Truly appreciated.

Share This Page