So I created my first snippet.. nothing great but does what i need it to.
Problem is I need to use the same snippet call (with different parameters) on the same page. But this isn’t working. It does the first call correctly and then just spits out the second snippet call to the page.
Any idea why?
Here’s my snippet code:
<?php
// initialize variables
$bh_int_style = isset($OutputStyle) ? $OutputStyle : ''; // check for style parameter
$bh_image_name = isset($ImageName) ? $ImageName : ''; // check for image parameter
$bh_int_mapnum = isset($MapNum) ? $MapNum : ''; // check for map number parameter
$bh_branch_name = isset($BranchName) ? $BranchName : ''; // check for branch name parameter
$bh_branch_url = isset($BranchUrl) ? $BranchUrl : ''; // check for branch url parameter
$bh_branch_add = isset($BranchAdd) ? $BranchAdd : ''; // check for branch address parameter
$bh_open_times = isset($OpenDaysHours) ? $OpenDaysHours : ''; // check if proper parameters set
$bh_array_days = ''; // holds the inital days array
$bh_array_open_close = array(); // holds finial days, open and close times
$bh_output = ''; // holds finial output
$bh_lab_vic = isset($SundayReason) ? $SundayReason : ''; // for sundays hour message
$bh_output_days = '';
include($modx->config['base_path'].'assets/snippets/test/test.inc.php');
?>
And the page that calls the snippet twice:
[[hours? &OutputStyle=`1` &ImageName=`test-small.jpg` &MapNum=`1` &BranchName=`test` &BranchUrl=`test.html` &BranchAdd=`test` &OpenDaysHours=`test|test|test|test|`]]
[[hours? &OutputStyle=`1` &ImageName=`test2-small.jpg` &MapNum=`2` &BranchName=`test2` &BranchUrl=`test.html2` &BranchAdd=`test2` &OpenDaysHours=`test2|test2|test2|test2|`]]