Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MuhammadFayed 2 posts 42 karma points
    May 14, 2023 @ 08:36
    MuhammadFayed
    0

    Folder Structure in Templates

    Hello,

    One of the main reasons I have not used Umbraco yet, is that there is no ootb way to organize the razor templates in physical folders structure as any standard asp.net application.

    And I still don't know if there is a clean way to do it while templates can still be aware of the physical location of the view inside sub-folders of (~/Views).

    As I want to organize templates per modules to keep the views clean and easy to access when I have hundreds of them.

    Otherwise, if you may suggest a way to organize lots of templates of different modules. without keeping them together in the same folder.

    ~/Views/module1/
                    template1
                    template2
    
    ~/Views/module2
                   template3
                    ...
    

    missing folder structure

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    May 22, 2023 @ 14:24
    Frans de Jong
    0

    We solved this by using the Templates (Views folder) only for page templates.

    Everything else goes into the partial views folder if it needs to be visible in the Umbraco Backoffice.

  • MuhammadFayed 2 posts 42 karma points
    Jun 01, 2023 @ 13:51
    MuhammadFayed
    100

    Thanks Frans for your reply

    I found some articles about route hijacking which can really help to achieve the required physical structure on the project/code level at least

    https://docs.umbraco.com/umbraco-cms/reference/routing/custom-controllers/

Please Sign in or register to post replies

Write your reply to:

Draft