Jump to content

Adding custom content


Recommended Posts

I am trying to add custom content to homepage.

 

I ran

{include file="file.php"}

and in that file put in the
$smartyvalues["value"] = "Content";

 

but it is not showing. I ran the {debug} console and the file is being included, but the content is not. Is custom PHP not able to be included this way?

Link to comment
Share on other sites

If you are including file.php into your index TPL file then in file.php you should do something like:

$this->assign('value','Content');

 

Because if you were to do it straight into the .tpl this is what would be used:

{php}$this->assign('value','Content');{/php}

Link to comment
Share on other sites

lol. um then may be you should of opened tieckt?

lol. um no. I actually need a staff member to reply to this.

 

lol. um You own .php file will need to be the same as if it was being coded in your .tpl file else all othere PHP goes in to the main PHP file (Yes I now 90% of whmcs files are encoded).

 

The PHP is in a PHP file, not in the TPL file.

Link to comment
Share on other sites

What I am getting at, is if your IN the TPL file, which is IN smarty, why would you assign a smarty value to something, thats a waiste of code. and if you look at this page...

 

http://wiki.whmcs.com/Creating_Pages

 

Is says exactly what I did. Thats what I meant by can not you not assign them from with in the include file?

 

I will try the $this->

 

And if I open a ticket, then no one else will get to see the answer would they?

Link to comment
Share on other sites

But you are not "Creating Pages" a new page so that link is not valid.

 

And while you are spending all this time on trying to get smarty "$smartyvalues["value"] = "Content";" code to display why do you not just put {php} your full STD PHP code{/php} in the include file.

 

And as to

I don't want to load my TPL files down with PHP. Smarty recommends against doing this, because of slow downs.
there is not that much of a differences and this would stand more if the .php file was not encoded but as it is they "smarty" would also say just use {php}{/php} instead.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated