Jump to the post that solved this thread.
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 9 Years, 7 Months, 1 Week ago Create a new custom template and call in other templates?
#1
Solved: 9 Years, 7 Months, 1 Week ago
This user has been denied support. This user has been denied support.
How can we create and add a new custom template in the themes&templates and call it in other template files?

Example: default "index_boardstats" is called in "index" template as "{$index_boardstats}"

i tried adding like above but failed.
MyPlugins:1-2-3-4-5
MyTutorials:AddBots
#2
Solved: 9 Years, 7 Months, 1 Week ago
I would also like the answer to this as i was planning on playing around with adding something to ucp
#3
Solved: 9 Years, 7 Months, 1 Week ago
Just create a template with the code you want to display and in the template you want it to appear, call it with {$yourtemplatenamehere}
No PM support
My YouTube
#4
Solved: 9 Years, 7 Months, 1 Week ago
This user has been denied support. This user has been denied support.
not working
MyPlugins:1-2-3-4-5
MyTutorials:AddBots
#5
Solved: 9 Years, 7 Months, 1 Week ago
It's not as simple as that, you need to tell it which template in the PHP files.

For example, in index.php you'll find this:
eval("\$boardstats = \"".$templates->get("index_boardstats")."\";");
#6
Solved: 9 Years, 7 Months, 1 Week ago
Putting a $ infront of a template name and putting { } around it won't make it load that template., it needs the PHP posted above to tell it what that variable actually contains.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
#7
Solved: 9 Years, 7 Months, 1 Week ago
This user has been denied support. This user has been denied support.
Thank you ajs and matt, it worked. Smile

added a line,
eval("\$newtemplatename = \"".$templates->get("newtemplatename")."\";"); 
in index.php
and called that template as {$newtemplatename} in the template i needed. It worked fine.
MyPlugins:1-2-3-4-5
MyTutorials:AddBots
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)