Jaroslav Štika
Jaroslav Štika

Reputation: 51

ATK4 How change view

....Views can have a default template or it can be specified or inherited. For example - default template of Api class is "shared.html" - that's where your header/footer is....

How or where can I change default view/template from shared.html e.g. to (3-columns-layout, 2-columns-layout, 1-columns-layout).html?

Upvotes: 1

Views: 211

Answers (1)

romaninsh
romaninsh

Reputation: 10664

Redefine a function called defaultTemplate() in api and return the name of a new file. Normally when you do that you also add some logic based on page names. Below is example

function defaultTemplate(){
    if($this->page=='index')return array('index');
    return array('shared');
}

If you need to use columns, look into 'View/Columns' class.

Upvotes: 2

Related Questions