![]() |
|
|
#1
|
|||
|
|||
|
Is there any way to add a template from within some inline php?
I'm trying to use the following code to display a MonkeyCMS template if a particular image exists on the server: PHP Code:
|
|
#2
|
|||
|
|||
|
How does this look?
Code:
%% $filename = 'usedstock/output/AA08NNU1.jpg'; $template1 = "Index:UsedCarThumbnail01"; if (file_exists($filename)) ** addToOutput ("\n"); displayTemplate(getTemplate($template1)); addToOutput ("\n"); ** %%
|
|
#3
|
|||
|
|||
|
Beauty! Thanks for the quick reply Colin!
![]() |
|
#4
|
|||
|
|||
|
If you were to have this in a loop then I'd look at moving the getTemplate function outside of the loop as it'll be a little more efficient to do that.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|