D
D
DeniSidorenko2020-05-11 05:42:19
opencart
DeniSidorenko, 2020-05-11 05:42:19

How to create additional text pages?

Opencart has standard pages like about us, contacts, etc. (templates in information/*.tpl) . The question is how to create more such pages. I have about 10 text ones (with different designs), but in standard opencart there are much fewer available ones.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2020-05-11
@Asokr

If the design of the blocks (header, footer) is the same - insert the layout directly into the studio in the admin panel.
If the page is completely different from the main site, then I would make a field in the information, a checkbox of the "own layout" type, and in the controller I would display a separate template file for my layout, something like:

if ($svoya_verstka) {
$this->response->setOutput($this->load->view('information/information_empty', $data)); // наш файл шаблона
} else {
$this->response->setOutput($this->load->view('information/information', $data));
}

Well, accordingly, in the information_empty template - I would leave only the output of the article content: And I also added the layout to the admin panel ... ----------------- If you want something then type contact.tpl - that is, for all 10 designs - 10 template files - then just copy the contact.tpl structure (controller, template file, and language file) - and change contact everywhere - to your own identifier, type design1.tpl for the file template, and design1.php - for the controller and language, and in the controller, you will also have to replace contact with design1 everywhere and so on 10 times ...))
<?php echo $description; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question