2011-03-17, 12:50 AM
Hi there,
I have been trying to accomplish this in a few different ways over the past few days with no luck.
Here is an example of what I want to do.
Say I wanted to add a Konami Code to my website (a script that performs an action when I enter a cheat code), however I did not want to clutter the code into my headerinclude.
I created a new template with the script for my Konami Code and called it konami. The Konami template is now included under my ungrouped templates in my main style.
I went into my global.php and added in:
I then added to my headerinclude {$konami} exactly where I would normally put the script and it would work. When I visit my website, the script is not there.
It works if I just put all of the code for the script into the headerinclude.
What am I missing?
Cranium
I have been trying to accomplish this in a few different ways over the past few days with no luck.
Here is an example of what I want to do.
Say I wanted to add a Konami Code to my website (a script that performs an action when I enter a cheat code), however I did not want to clutter the code into my headerinclude.
I created a new template with the script for my Konami Code and called it konami. The Konami template is now included under my ungrouped templates in my main style.
I went into my global.php and added in:
eval("\$konami = \"".$templates->get("konami")."\";");
I then added to my headerinclude {$konami} exactly where I would normally put the script and it would work. When I visit my website, the script is not there.
It works if I just put all of the code for the script into the headerinclude.
What am I missing?
Cranium