PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, October 26, 2022

[FIXED] How to add footer.tpl to .php file

 October 26, 2022     html, javascript, php, prestashop, prestashop-1.7     No comments   

Issue

I would like to add a footer.tpl file to product_gallery.php in Prestashop.

I'm doing it like bellow:

product_gallery.php


 <!DOCTYPE html>
 <html>
 <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="style_gallery.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script src="/gallery/js/gallery_button.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1">

 </head>
 <div class="logo"><a href="" class="logo_link"></a></div>
 <body>
<div class="nav_buttons">
  <ul class="tabs">
     <a data-filter=".group-1" href="#" class="group_link"><button class="button_search">Koszule</button></a>
     <a data-filter=".group-2" href="#" class="group_link"><button class="button_search">Sukienki</button></a>
     <a data-filter=".group-3" href="#" class="group_link"><button class="button_search">Spódnice</button></a>
     <a data-filter=".group-4" href="#" class="group_link"><button class="button_search">Spodnie</button></a>
     <a data-filter=".group-5" href="#" class="group_link"><button class="button_search">Swetry</button></a>
     <a data-filter=".group-6" href="#" class="group_link"><button class="button_search">Płaszcze</button></a>
     <a data-filter=".group-7" href="#" class="group_link"><button class="button_search_all">Wszystkie produkty</button></a>
  </ul>
</div>

<div class="thumbnails grid" id="portfolio">

  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-1 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-2 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-3 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-4 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-5 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-6 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-1 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-2 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-3 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-4 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-5 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-6 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-1 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-2 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-3 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-4 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-5 group-7"></a>
  <a href="#"><img src="gallery/M01.jpg" alt="" class="group-6 group-7"></a>

</div>
   <?php
     {include '/themes/TheStyle/templates/_partials/footer.tpl';}
   ?>
</body>
</html>


This code gives result as follow:

Failed to open stream: No such file or directory and 403 error: permission denied. My question is: How to solve this problem and display a footer.tpl file from prestashop at other .php page created by me?


Solution

It's nowhere like this. You have to create a module (or an override for an existing controller) over there you will use the setTemplate function.

Keep in mind that normally your template shouldn't be complete. It will have

{extends file='page.tpl'}

on the top.

In case you like to include only the footer but no header you have to make a block around the header and make

{block name='header'}{/block}

to make it empty.



Answered By - Konstantinos A. Kogkalidis
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing