whmcs title code how i can modified? - whmcs

my whmcs title code show beleow. i want to modified it.
<title>{if $kbarticle.title}{$kbarticle.title} - {/if}{$pagetitle} - {$companyname}</title>
i want when i go my site homepage/index page then show this code like that
<title>{$companyname} - {$pagetitle}</title>
but when i go other page like shared hosting,reseller hosting etc then code show that
<title>{$pagetitle} - {$companyname}</title>
how i can do it. it possible?

You Should Some Modified Mr Caner G code. like this. i think it will be work.
<title>{if $filename eq "index"}{$companyname} - {$pagetitle}
{else}{$pagetitle} - {$companyname}{/if}</title>

In your templates, find header.tpl, use the following code :
{if $filename eq "index"}
<title>{$companyname} - {$pagetitle}</title>
{else}
<title>{$pagetitle} - {$companyname}</title>
{/if}

Yes it is possible. Please check the following offical document of WHMCS(Page titles section) : http://docs.whmcs.com/Seo

Alternatively you could use the template var {$isIndex}.
Like so
<title>
{if $isIndex}
{$companyname} - {$pagetitle}
{else}
{$pagetitle} - {$companyname}
{/if}
</title>
When in doubt about what template vars are available to you in WHMCS you can always use the {debug} command

Related

How to include a checkbox image in a Qweb Report?

Is there way to change checkbox image in qweb report. For example i want to change standard "V" to image like this:
Is it possible?
Solution 0
Add the file to your module, for example store it in the path /module_name/static/src/img/image_name.png
Then now you can add the image to the Qweb Report:
<img t-att-src="'/module_name/static/src/img/image_name.png'" />
Note: respect the order and the type of the quotes
Solution 1
Maybe it is useful to create ul html list with all the elements you want to add:
<style>
.icon_list {
list-style-image: url('/module_name/static/src/img/image_name.png');
}
</style>
<!-- [...] -->
<ul class="icon_list" >
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
(I didn´t try it but it should work as well)
you can simply replace it with the standard Unicode character ☑ by a field that is checking the status
Please use "input type as checkbox". It worked for me.
<input type="checkbox" checked="checked"/>I agree that glasses are selected based on my indications
in odoo11
you can choose this class for checkbox
i class="fa fa-check which opening and closing tags This gives better checkbox than default in odoo

Remove "Social Title" from order form in Prestashop?

I have just downloaded and installed the latest version of Prestashop. And found out there is a Social Title-option in order checkout form.
I want to remove that. I have found how to remove the Mr and Mrs boxes. But the whole row and label "Social Title" remains.
Have tried to search on Google for an answer but can't find. Some answers refer to the addresses.tpl. But I think the templates might been changed since these threads.
In fact, I have tried to search for "social" in the whole template directory and can't find anything related to this.
The nearest I get is in the ../templates/customer/_partials/customer-form.tpl. And I think it's rendered where this is:
<section>
{block "form_fields"}
{foreach from=$formFields item="field"}
{block "form_field"}
{form_field field=$field}
{/block}
{/foreach}
{/block}
</section>
So, maybe the social title isn't able to change from templates anymore?
So, where do I change it nowadays?
In Prestashop 1.7 there is no need to edit any code, you can just go to Shop Parameters -> Customer Settings -> Titles and remove all existing titles.
This will prevent the "Social title" field from being generated.
Shop Parameters -> Customer Settings -> Titles - Delete titles
themes/xxx/templates/_partials/form-fields.tpl 9th line change
{if $field.type !== 'checkbox'}
{$field.label}
{/if}
to
{if $field.type !== 'checkbox' and $field.type !== 'radio-buttons'}
{$field.label}
{/if}
Yeah, it's kind of dummy workaround, but it works.
UPDATE:
More proper way would be to comment the block:
$genderField = (new FormField)
->setName('id_gender')
->setType('radio-buttons')
->setLabel(
$this->translator->trans(
'Social title', [], 'Shop.Forms.Labels'
)
)
;
foreach (Gender::getGenders($this->language->id) as $gender) {
$genderField->addAvailableValue($gender->id, $gender->name);
}
$format[$genderField->getName()] = $genderField;
You can find it in /classes/form/CustomerFormatter.php
You can find the code for Social Titles in file at the following path:
/themes/default-bootstrap/identity.tpl
Note: It is not a good practice to remove the code from a core file, we recommend to apply some CSS to hide the Social Title block.

Drupal 8 - Get comments area on custom template

I am trying to get the comment form with all comments on a custom template article page of drupal. I can get the whole content with {{ page.content }} or get the comments by using {{ node.field_comments }} and make a loop on it (assuming my field comment machine name is field_comments).
But does anyone know I to render the whole comments block with :
links to add a comment
comments
comment form
Thank you very much for your help !
Try to use the new and refined comment module. It's in the core so all you have to do is enable it. After that just make a comment type, add it to your article and display. That's pretty much it.
In template files for a content type (eg node--article.html.twig), you have the 'content' variable available. I use this bit of Twig to render the whole comments block:-
{{ content.comment }}
I struggled with this too, but just for the next visitor, I got 2 out of 3 (I didn't want the form on my page)
- links to add a comment -> {{ content.links }}
- comments -> {{ content.comment_node_TYPE }}
To get the correct name for content.comment_node_TYPE, visit your Mange fields page for that content type and see what the comment field is called
e.g. my "Audio" content type names the field {{ content.comment_node_audio }}
Hope this helps someone in future

Odoo Qweb check for contact title

I am currently working on my first Odoo (v8) template and want to check if a contact person has a specific title.
What currently works is:
Sehr geehrter <span t-field="o.partner_id.title"></span> <span t-field="o.partner_id.name"></span>
This outputs:
Sehr geehrter Herr Klaus Koffer
As you can see I use the german translation of the system.
My question is: How can I check for "Mister" and "Miss"? The following example does not work. Is there a way to get the internav values as they are obviously not "Mister".
<p t-if="o.partner_id.title == 'Mister'">
Thanks in advance.
You can refer our blog to know about qweb.
Just try it in your code.
t-if="o.partner_id.title.name == 'Mister'"
Because o.partner_id.title gives an object of res.partner.title model.
So, you have to user o.partner_id.title.name. that's it.
Just you can check the condition using <t> </t> Tag for add the condition in Qweb View.
Better way u should use the <t> Tag insted of <p> Tag
some thing like this
<t t-if="o.partner_id.title == 'Mister'">
Your login will add hear for Mister title
</t>
I hope this should helpful for you ..)

Smarty template variable carry to header.tpl

Editing the WHMCS template files (smarty) I can't seem to carry this variable outside of its tpl page and into the header.
knowledgebase.tpl
{assign var="page_alias" value="knowledgebase"}
header.tpl
{assign var="active_link" value="my value"}
{if isset($page_alias) && $page_alias == 'knowledgebase'}
{$active_link}
{else}
{}
{/if}
If all that is on the same page it outputs "my value". but when I have it setup on pages as described above it returns nothing. I've also tried the scope='global' at the end of the first code.
I see several people with similar questions on here but none seem to have an actual answer.
Use session instead. I had the similar problem. Couldn't find any solution. Even contacting WHMCS support did not help! So I just used session variables to handle my job.