1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Template assigments: bug or misunderstanding ?

Discussion in 'Free Divi Community Forum' started by Acataseb, Dec 19, 2024.

  1. Acataseb

    Acataseb New Member

    Hi people,
    I am working on a fresh new website powered by Wordpress (latest), Woocommerce (latest) and DIVI (latest) with a DIVI child theme. I have some troubles with DIVI's templates assignment logic. Here is the setup at the moment :

    On the Woocommerce side of the project, products are organized in categories like this :

    • Products (the default cat., not used but mandatory)
    • AAA
    ⊦ AAA_subcat_1
    ⊦ AAA_subcat_2
    ⊦ (...)
    • BBB
    ⊦ BBB_subcat_1
    ⊦ BBB_subcat_2
    ⊦ (...)
    • CCC
    ⊦ CCC_subcat_1
    ⊦ CCC_subcat_2
    ⊦ (...)

    On the DIVI theme builder side of the project :

    Template AAA_TPL
    Used on : Specific Product Category Pages > AAA
    Excluded from : -

    Template BBB_TPL
    Used on : Specific Product Category Pages > BBB
    Excluded from : -

    Template CCC_TPL
    Used on : Specific Product Category Pages > CCC
    Excluded from : -

    Template GLOBAL_TPL
    Used on : All Product Category Pages, All Product Tag Pages
    Excluded from : Specific Product Category Pages > AAA, BBB, CCC

    What is expected :
    All Woocommerce taxonomy archive pages use GLOBAL_TPL except the archive pages of AAA, BBB and CCC categories which should use their own template (AAA_TPL, BBB_TPL, CCC_TPL).

    What is really happening :
    All product tag pages are using GLOBAL_TPL --> OK.
    AAA, BBB, CCC archive page are using respectively AAA_TPL, BBB_TPL, CCC_TPL templates --> OK.
    AAA_subcat_1, AAA_subcat_2, etc. are also using AAA_TPL wich is NOT OK.
    Same for BBB_subcats, CCC_subcats --> NOT OK.

    Do I miss something on how DIVI's template assignment works or is it a bug ?

    PS: I made it work AAA the way it was expected with this configuration, but it sounds crazy to do this.

    Template AAA_TPL
    Used on : Specific Product Category Pages > AAA
    Excluded from : Specific Product Category Pages > "All categories except AAA"
     
    1. PRO MEMBER PERKS Beautifully crafted custom colored 'Industrial' Divi layout for all Pro members:View Demo
  2. Divi Booster

    Divi Booster Divi Expert

    I just checked with standard (non-product) categories and they behave the same way - if a sub-category doesn't have a template it will "inherit" the one used by the parent category. I don't know if this is intentional, but this type of inheritance is pretty common and probably required additional work to implement, so I'd imagine so...

    Glad you found a workaround, and thanks for sharing!
     
  3. Acataseb

    Acataseb New Member

    DIVI support confirmed this is the intended behavior, so, unless a bunch of php code to override this, I'm condamned to this workaround. Anyway, I still don't understand why DIVI developers don't respect the logic of the template hierarchy where when you create a specific template (say based on slug, for example), it is only used by the category which have this unique slug.
     
    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Modern & powerful Agency Divi layout pack, featuring team carousel, sliding menu, etc.View Demo
  4. Divi Booster

    Divi Booster Divi Expert

    Yeah, I don't know why they've chosen this interpretation over any other. Thanks for confirming their response though - I guess at least we can expect the current behavior to remain in place.