N
N
NIKOOV2018-03-14 10:40:15
opencart
NIKOOV, 2018-03-14 10:40:15

Where can I find "Articles" in OpenCart?

Where can I find the section "Articles" and its contents in the file access of the management system. That is, for example, I want to change the page data not through the graphical interface, but directly through the file, or, for example, to find out the variable name of this article in order to insert a link to this article into the code of any of the pages. In footer.tpl, I only see a loop that takes each of the articles and displays them, but I can’t understand where it takes them from)

<?php foreach ($informations as $information) { ?>
          <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } ?>

Here, for example, where he gets href, title. Thanks in advance!)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Pavel, 2018-03-14
@NIKOOV

The data of the article itself is stored in the database, not in files. You can change them using files, you need to create a script to connect to the database, select articles and select the desired article, display it and edit it, and after recording.

A
Andrey Sanych, 2018-03-14
@mountpoint

everything is stored in the database, you need to edit it, not the file

Z
zoozag, 2018-03-14
@zoozag

You have a lot of confusion in your head right now, judging by the question. And you are trying to come up with a solution to some problem, I don’t understand how Opencart works in principle.
1. It is better to ask a question not according to your solution to the problem, but according to how your problem is best solved.
2. Read how Opencart works in principle. What is Database, Model, Controller, Template. If you plan to solve your problems on your own, it is better to start with the basics.
Now for the content of the question:
You have already correctly noticed that the content of the article is stored in the database.
The graphics editor has a source code mode. You can copy the source code into your favorite editor, edit it there, and paste it back in.
The template takes data from the controller. A controller from the model.

N
NIKOOV, 2018-03-14
@NIKOOV

Yes, thank you, I understand a little. And I solved my problem by inserting an element from the $informations array (in my case), specifying the index of the element, and then pulling out the value by the key that was needed. With php and Opencart, in principle, only the first day I start working :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question