Karush Posted January 15, 2020 Share Posted January 15, 2020 Hello everyone, I created a new page, but I can’t display the form for finding a domain on it. This form is displayed only on the main page. What should I do? {if $registerdomainenabled || $transferdomainenabled} <form method="post" class="domain-search-form" action="domainchecker.php" id="frmDomainHomepage"> <input type="hidden" name="transfer" /> <input type="text" name="domain" placeholder="{$LANG.exampledomain}" autocapitalize="none" data-toggle="tooltip" data-placement="left" data-trigger="manual" title="{lang key='orderForm.required'}"> {* <input type="submit" value="Поиск">*} {if $registerdomainenabled} <input type="submit" class="btn search{$captcha->getButtonClass($captchaForm)}" value="{$LANG.search}" /> {/if} {include file="$template/includes/captcha.tpl"} </form> {/if} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 15, 2020 Share Posted January 15, 2020 3 minutes ago, Karush said: What should I do? get rid of that IF statement and the closing {if} statement - those conditions will never be met on a custom page, so that's why the form won't show. on a general point, you often (nearly always!) can't copy&paste code from one template into another and expect it to work. the code in the thread below will work - it's just needs CSS applying to it to suit your site... it's basically the code from the Integration Code in Utilities... https://docs.whmcs.com/Linking_to_WHMCS#Integrating_a_Domain_Availability_Check_into_your_Website or another way would be to use the domainchecker data feed. 0 Quote Link to comment Share on other sites More sharing options...
Karush Posted January 15, 2020 Author Share Posted January 15, 2020 5 minutes ago, brian! said: избавьтесь от этого оператора IF и оператора закрытия {if} - эти условия никогда не будут выполнены на пользовательской странице, поэтому форма не будет отображаться. в общем, вы часто (почти всегда!) не можете копировать и вставлять код из одного шаблона в другой и ожидать, что он будет работать. код в цепочке ниже будет работать - ему просто нужно применить CSS, чтобы он соответствовал вашему сайту ... это в основном код из кода интеграции в утилитах ... https://docs.whmcs.com/Linking_to_WHMCS#Integrating_a_Domain_Availability_Check_into_your_Website или другой способ - использовать поток данных domainchecker . But how can I deduce in this way how on the main there are some restrictions? 0 Quote Link to comment Share on other sites More sharing options...
Karush Posted January 15, 2020 Author Share Posted January 15, 2020 Just now, Karush said: But how can I deduce in this way how on the main there are some restrictions? I'm just a novice and not really good at it 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 15, 2020 Share Posted January 15, 2020 44 minutes ago, Karush said: But how can I deduce in this way how on the main there are some restrictions? always assume that there are... unless you find otherwise. 🙂 for example, you can't copy the code from the invoices template and expect it to work on a custom page - it won't - because the invoices template is passed arrays of data to output and a custom page won't have those arrays. 47 minutes ago, Karush said: I'm just a novice. we all were once. 0 Quote Link to comment Share on other sites More sharing options...
Karush Posted January 15, 2020 Author Share Posted January 15, 2020 9 minutes ago, brian! said: всегда предполагайте, что есть ... если вы не найдете иначе. 🙂 например, вы не можете скопировать код из шаблона счетов и ожидать, что он будет работать на пользовательской странице - это не будет - потому что шаблону счетов передаются массивы данных для вывода, и пользовательская страница не будет иметь этих массивов , мы все были когда-то. already made thank you very much but can I use these arrays or not 0 Quote Link to comment Share on other sites More sharing options...
Karush Posted January 15, 2020 Author Share Posted January 15, 2020 10 minutes ago, brian! said: always assume that there are... unless you find otherwise. 🙂 for example, you can't copy the code from the invoices template and expect it to work on a custom page - it won't - because the invoices template is passed arrays of data to output and a custom page won't have those arrays. we all were once. and one more question can I display the price list of domains on a custom page, if so, how 0 Quote Link to comment Share on other sites More sharing options...
Karush Posted January 15, 2020 Author Share Posted January 15, 2020 11 minutes ago, brian! said: always assume that there are... unless you find otherwise. 🙂 for example, you can't copy the code from the invoices template and expect it to work on a custom page - it won't - because the invoices template is passed arrays of data to output and a custom page won't have those arrays. we all were once. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 15, 2020 Share Posted January 15, 2020 12 minutes ago, Karush said: already made thank you very much but can I use these arrays or not on the original default page, yes - on a custom page, they probably won't exist.... some arrays/variables are available in all pages (including custom); arrays that are available to a specific existing page, will not be available to a custom page. 13 minutes ago, Karush said: one more question can I display the price list of domains on a custom page, if so, how I should mention first that there is already a separate domain pricing page available in WHMCS - you should just need to go to yourdomain.com/domain/pricing/ (the url might change depending on your friendly URLs settings)... even if you could copy the Smarty code from the existing template (either above or domain register), to do the same on a custom page would require at least 2 arrays to be recreated using action hooks - you would probably need to play with the CSS too. there's a domain pricing table data feed, but you would need to add css or rewrite the code to make it look like the default domain pricing table. 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.