View Single Post
  #2  
Old 01-29-2015, 03:11 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Adding a page with my own PHP Code

Well, you need to include your PHP script. Finding a good place to put your include can be a challenge.

It sounds like you are using a static page, perhaps pages.php would be a good place to place your include. Then in your php file, you need to assign the array or variable that you want to reference to smarty, the template engine.

Code:
$smarty->assign('guitarists', $guitarists);

Then you can reference it in you page, assuming that you have checked the box to "Parse Smarty tags in the content of embedded pages" in the pages section of the admin.

Then you can build a foreach loop to loop through your array.

Code:
{foreach from=$guitarists item=guitarist} Name:{$guitarist.name} Birthday:{$guitarist.birthday} {/foreach}
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote