ZealousWeb
  • Member for 1 year
  • Last seen this week
How can I count current indexing inside a loop?
Accepted answer
3 votes

Twig offers special loop variables that makes it easy to know indexing of a loop. You can use loop.index to count your current indexing of the loop, which will starting at 1. If You want to start your ...

View answer
How to convert currency is there any way or any plugin available?
2 votes

Craft cms provide a plugin to convert currency. Here is the link: https://github.com/leowebguy/craft-currency-converter You can use this plugin as we have already used it and it's very easy to ...

View answer
Debugging Craft CMS templates on Visual Studio Code
2 votes

There are so many Extensions available on visual studio code. You can install for the language snippets, for auto-suggest code, and for checking syntax. If you are looking for the debug page load ...

View answer
Is there any way to adjust the width of the custom field in the admin panel?
Accepted answer
2 votes

You can adjust it by following below steps: First go to Settings > Sections > Select Edit Entrytype of a section.
 Then choose your Custom field and then you find four pieces block icon on the ...

View answer
Can I create multiple website using the same admin control panel and what I have to change for that?
Accepted answer
2 votes

Yes, you can create it. Follow below steps and create new website using same control panel. You should go to Settings > Sites You can create another website using same admin Handle site at section ...

View answer
Remove item from cart
2 votes

You can remove a line item by including a remove parameter in the request. This example adds a checkbox the customer can use to remove the line item from the cart: {% set cart = craft.commerce.carts....

View answer
I have a custom table in my craft plugin at the backend and I have to include custom sorting on each field of the table using javascript
1 votes

Please follow the below steps. Use a sorting class for each field. <table class="data"> <thead> <tr> <th class="sorting" >Name</...

View answer
I am working on a plugin and I have to use a method of one controller in another controller's method?
Accepted answer
1 votes

In viewController you can simply access your method like this: public function actionDetails(){ $data = DefaultController::statistics(); return $data; } I hope this will ...

View answer
When creating new assets what should we put in base Url and document root file?
1 votes

You can use the aliases for that. @web and @webroot are aliases which are included in Craft by default, @web is pointing to the base website url and @webroot is pointing to the document root file path ...

View answer
Is there any way which does not remove Specific Html tags from the redactor editor using striptags only?
Accepted answer
1 votes

You can simply use striptags filter which removes all HTML tags. But if you want an html tag to be not removed by striptags so you can pass it as argument, then It removes other tags except the ones ...

View answer
How can I get contact form added information on the control panel?
Accepted answer
1 votes

You can find the Contact Form Extensions plugin in plugin store. It’s free to use. 

 Install it and then fill the setting form as you need it. After that settings completed you will see the new ...

View answer
How to include Inline JavaScript?
1 votes

You can use {% js %} Twig tag. It is essential to using JS in Twig. It takes JS code passed to it and appends it at end of the template, right before ending body tag. Multiple js tags can be used - ...

View answer
Can I store Assets on a Cloud Service like Amazon S3?
Accepted answer
1 votes

Yes, you could install the Amazon S3 Plugin in order to select & configure that Volume type in your control panel. After installing that you will get new volume type “Amazon S3” in Settings → ...

View answer
How to set Home page menu as active when slug is not defined in admin panel?
Accepted answer
1 votes

craft.request is useful for setting an "active" class based on URL segments without slug. In your template you can set a slug in twig and then you can run if statement to check what the ...

View answer
How Can I load Inline CSS in the Redactor Editor?
Accepted answer
1 votes

You should first go to the Settings > Fields Then click on the particular field in which you have selected the Redactor as a field type. Then you can see Advanced option at the end of the page and ...

View answer
Is it possible to image upload on a particular size using a control panel?
Accepted answer
1 votes

Yes, you can use image transform option for that. You should go to control panel and go to below path Settings > Assets > Image Transforms Then create new image transform. Using it, you can ...

View answer
How to round the decimal value which we store in the admin panel?
Accepted answer
1 votes

Twig offers various filters. So to round the decimal value, we can use a round filter. The round filter rounds a number to a given precision: {{ 42.55|round }} {# outputs 43 #} {{ 42.55|round(1, '...

View answer
Want to add a custom field in craft commerce plugin
Accepted answer
1 votes

Yes, you can create new field and you can add it in it. To add it, please go to admin panel and then follow the below mentioned sections. settings > product type > add/select product > ...

View answer
How can I get the cart total item? I tried using a “length” filter but it’s not working with that
Accepted answer
1 votes

You can use the totalQty method to fetch total items from the cart. It’s a predefined method in the commerce plugin to get total items. Also you can find other methods like this in the documentation ...

View answer
Query for multiple date ranges on a date field
1 votes

You can use two queries, each for each range, and then merge them like this: {% set firstRange = craft.entries({fieldHandle: ['and', '>= '~date1FirstDay, '< '~ date1LastDay]}) %} {% set ...

View answer
How to include external JavaScript in place?
1 votes

In your template you can use the <script src=""> tag as it's a combination of the html and twig. So it will load your external javascript files. Also you can use the inline javascript ...

View answer
Testing database credentials Craft 3 Setup
1 votes

This might be the problem with the pgsql driver. You need to install and activate postgresql extension in PHP You can use below command to install it. [sudo] apt-get install php-pgsql For activating ...

View answer
How can I revert a migrations from the control panel?
Accepted answer
0 votes

You can usually ignore the safeDown() method, as Craft doesn’t have a way to revert migrations from the control panel. For more information you can refer this documentation https://craftcms.com/docs/3....

View answer
Contact Form - Not sending emails
0 votes

Please check the attached screenshot. In your craft cms Admin panel Go to Settings -> Email as shown in the above screenshot. Please check that you have filled in all the detail in the email ...

View answer
Custom plugin settings add on admin nav bar
Accepted answer
0 votes

When you generate Craft CMS plugin and module code scaffolding on https://pluginfactory.io/ please turn on switch for CP section and then your plugin path/src/.php file in change $hasCpSection true. ...

View answer
Filter Entries by Custom date
0 votes

Bonus Answer: You can use after and before for that as well like below code. {% set catYear = craft.app.request.segment(-1) %} {% set firstDayOfYear = catYear ~ "-01-01" %} {% set ...

View answer