contao/import — Issue #3043: extend module settings with "module template"
Author: Toflar
Created: 2011-11-29 20:46:01+00:00
State: open
Labels: Accepted, backend, Feature

I stumbled across this problem several times recently.
We can currently choose templates in the modules but not the module template itself.
I think there are several examples where this can be cumbersome, so I just give you some of them.

* navigation: I can choose the nav_**.tpl but mod_navigation.tpl is unchangeable. I had a page with a horizontal main navigation bar (level 1 only) and a subnavigation on the left (level 2-3) where I wanted to include the page title as

so that you have the current page's title on top of the subnavigation. I could easily achieve this by adding

```
pageTitle)) ? $objPage->pageTitle : $objPage->title;
?>
```

to the mod_navigation.tpl. BUT: Now I have the problem that the title is displayed above the subnavigation as well as above the main navigation. I managed to implement this by an if-else clause of course but that's not really the nice way. I could have solved this by choosing the module's template. Subnavigation would have "mod_navigation_subnav.tpl" and the main navigation the default "mod_navigation".

* news: Imagine you want to display the latest news on your home page as an unordered list. That's currently really hard work because the rendering of every item happens in news_**.tpl so I could do my
things there but I'd need to add the wrapping

and

to the mod_newslist.tpl. Same problem as above: I could change it but the changes apply for all the other news lists as well. But what if on another page I want the news archive to be a default

template?

* events: same problem as for the news

* etc.

All these problems could easily be solved by providing the option to select the template for the **module itself**.
So I consider this to be a really great feature with a reasonable time needed to implement.

--- _Originally created on May 5th, 2011, at 10:47am (ID 3043)_