Post by zebdev » Sat Oct 22, 2011 3:01 am

Hi there,

In the footer for open cart v1.5.1 there is a section called information. It has about us etc.

I want to put those links in my header.tpl file of my custom theme. So making opencart a cms for pages as well as the store.


If I copy this code from footer.tpl

Code: Select all

<ul>
      <?php foreach ($informations as $information) { ?>
      <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
      <?php } ?>
    </ul>
I get an Undefined variable: informations error. Any direction on how to make this work?

Thank you

New member

Posts

Joined
Tue Sep 13, 2011 3:43 am

Post by uksitebuilder » Sun Oct 23, 2011 1:55 am

You also need to move the associated entries in catalog/controller/common/footer.php to catalog/controller/common/header.php and possibly catalog/language/english/common/footer.php to catalog/language/english/common/header.php

OpenCart uses MVC+L

In simple terms there are multiple files that make up a section. The 'V' part of MVC+L is the 'tpl' files or 'View' It will most definitely have a Controller file 'C' and more than likely a Language file 'L'

The footer does not interact with the database directly, so there is no Model file 'M'

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by zebdev » Mon Oct 24, 2011 2:32 am

Excellent thank you. I'm learning slowly and have it all working.

Any ideas how I can create a new tpl file for an information page? So that I can choose a new template for an information page within the admin section?

E.g. new information page called postage and use a tpl file called template. which I have styled.

New member

Posts

Joined
Tue Sep 13, 2011 3:43 am
Who is online

Users browsing this forum: No registered users and 19 guests