maxmoto Posted March 6, 2019 Share Posted March 6, 2019 Hello i am not a coder and want show the REFERRAL link from affialtes.tpl under the SEARCH Box on clienthome.tpl The only i am able to do is the Code copy on that place. It shows me the Translattion from language but not the Refferal Link can someone help me or explain me what i made wrong. I used that </form> /// here ends Search BOX {if $inactive} {include file="$template/includes/alert.tpl" type="danger" msg=$LANG.affiliatesdisabled textcenter=true} {else} <div class="affiliate-referral-link text-center"> <h4>{$LANG.affiliatesreferallink}</h4> <span>{$referrallink}</span> </div> {/if} /// here starts details {foreach from=$addons_html item=addon_html} Thx a LOT if possible 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 8, 2019 Share Posted March 8, 2019 On 06/03/2019 at 11:04, maxmoto said: i am not a coder and want show the REFERRAL link from affiliates.tpl under the SEARCH Box on clienthome.tpl The only i am able to do is the Code copy on that place. It shows me the Translation from language but not the Referral Link sadly, you can't just copy template code from one template, paste it in another and expect it to work if the variables that it wants to use don't exist on the new page - and in this case, referrallink doesn't exist on the homepage and there is no way to generate it from available Smarty variables in the template. there are a few ways to do this - one would be to do it *entirely* using an action hook with no need to edit the template... but as you're a new user, let's keep things simple for now and do it in two parts - first you need an action hook to create the $referrallink variable - so upload the attached .php file in /includes/hooks/ ... and then in your clientareahome.tpl template, you can use... {if $referrallink} <div class="affiliate-referral-link text-center"> <h4>{$LANG.affiliatesreferallink}</h4> <span>{$referrallink}</span> </div> {/if} .. to output your referral link - it will only appear for those clients who are affiliates. affiliatehome.php 0 Quote Link to comment Share on other sites More sharing options...
Samuel12321 Posted May 6 Share Posted May 6 On 3/8/2019 at 7:58 PM, brian! said: sadly, you can't just copy template code from one template, paste it in another and expect it to work if the variables that it wants to use don't exist on the new page - and in this case, referrallink doesn't exist on the homepage and there is no way to generate it from available Smarty variables in the template. there are a few ways to do this - one would be to do it *entirely* using an action hook with no need to edit the template... but as you're a new user, let's keep things simple for now and do it in two parts - first you need an action hook to create the $referrallink variable - so upload the attached .php file in /includes/hooks/ ... and then in your clientareahome.tpl template, you can use... {if $referrallink} <div class="affiliate-referral-link text-center"> <h4>{$LANG.affiliatesreferallink}</h4> <span>{$referrallink}</span> </div> {/if} .. to output your referral link - it will only appear for those clients who are affiliates. affiliatehome.php Please can you drop this file again, its cant be viewed anymore ( 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.