overwirting site template
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
overwirting site template
Hi,
i have integrated aimeos with laravel 8 and i have given a task to add extra field in site form.
When i try to overwirte the site template there are two directories in with site form is present
1) ext\ai-admin-jqadm\admin\jqadm\templates\locale\site\item-standard.php
2) ext\ai-sites\admin\jqadm\templates\locale\site\items-site.php
my aimeos app is using 2nd directorie(items-site.php) to render the site view
please tell which file do i have to overwrite in my extension and also how because there is no folder available in my
own extension(created through link given on aimeos documentation) to overwrite items-site.php
my extension folder contains
1)admin(folder)
2)client(folder)
3)config(folder)
4)controller(folder)
5)lib(folder)
6).gitignore
7)composer.json
8)manifest.php
9)phing.xml
i have integrated aimeos with laravel 8 and i have given a task to add extra field in site form.
When i try to overwirte the site template there are two directories in with site form is present
1) ext\ai-admin-jqadm\admin\jqadm\templates\locale\site\item-standard.php
2) ext\ai-sites\admin\jqadm\templates\locale\site\items-site.php
my aimeos app is using 2nd directorie(items-site.php) to render the site view
please tell which file do i have to overwrite in my extension and also how because there is no folder available in my
own extension(created through link given on aimeos documentation) to overwrite items-site.php
my extension folder contains
1)admin(folder)
2)client(folder)
3)config(folder)
4)controller(folder)
5)lib(folder)
6).gitignore
7)composer.json
8)manifest.php
9)phing.xml
Re: overwirting site template
Name your template file item-sites.php and add "ai-sites" to the "depends" section of the manifest.php file in the root of your extension. Then, your file is used instead of that from the ai-sites extension.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: overwirting site template
Thank you.it worked perfectly.It would be great if you guys make some video tutorials on the customization of admin panel or
make some changes in documentation in order to make it easy for new developers because the documentation is very hard to
understand.Thanks again.
Re: overwirting site template
Help is always welcome! Create a PR and add a clarification to the page or section where information is missing here:
https://github.com/aimeos/aimeos-docs
Don't be afraid if your sentences are not perfect, we will check, fix and extend your PR before merging.
https://github.com/aimeos/aimeos-docs
Don't be afraid if your sentences are not perfect, we will check, fix and extend your PR before merging.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: overwirting site template
Hi,aimeos wrote: ↑20 Jan 2021, 13:02 Help is always welcome! Create a PR and add a clarification to the page or section where information is missing here:
https://github.com/aimeos/aimeos-docs
Don't be afraid if your sentences are not perfect, we will check, fix and extend your PR before merging.
i have successfully added field in site form and also added a field in table by adding a file locale.php in the
directory ext\ai-moudhah\lib\custom\setup\default\schema. that file contains the following code
Code: Select all
return [
'table' => [
'mshop_locale_site' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
$table = $schema->getTable( 'mshop_locale_site' );
$table->addColumn( 'city', 'string', ['length' => 255] );
return $schema;
}
]
];
directory ext\ai-moudhah\lib\custom\src\MShop\Locale\Manager\Site\Decorator\Myproject.php that file contains the following code
Code: Select all
namespace Aimeos\MShop\Locale\Manager\Site\Decorator;
class Myproject extends \Aimeos\MShop\Common\Manager\Decorator\Base
{
private $attr = [
'city' => [
'code' => 'city',
'internalcode' => 'city',
'label' => 'My new column',
'type' => 'string',
'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
],
];
public function getSaveAttributes()
{
return parent::getSaveAttributes() + $this->createAttributes( $this->attr );
}
public function getSearchAttributes( $sub = true )
{
return parent::getSearchAttributes( $sub ) + $this->createAttributes( $this->attr );
}
}
Code: Select all
return [
'site' => [
'manager' => [
'decorators' => [
'local' => ['Myproject']
]
]
]
];
the field which i have added is
Code: Select all
<div class="form-group row mandatory">
<label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'City' ) ); ?></label>
<div class="col-sm-8">
<input class="form-control item-city" type="text" tabindex="1"
name="<?= $this->formparam( array( 'item', 'locale.site.city' ) ); ?>"
placeholder="<?= $enc->attr( $this->translate( 'admin', 'Internal name (required)' ) ); ?>"
value="<?= $enc->attr( $this->get( 'itemData/locale.site.city' ) ); ?>" />
</div>
</div>
Re: overwirting site template
would you please reply me.i am waiting for replyaimeos wrote: ↑20 Jan 2021, 13:02 Help is always welcome! Create a PR and add a clarification to the page or section where information is missing here:
https://github.com/aimeos/aimeos-docs
Don't be afraid if your sentences are not perfect, we will check, fix and extend your PR before merging.
Re: overwirting site template
This seems to be wrong:
It should be in ./config/mshop.php of your extension:
PS: If you need immediate support, you should buy individual developer support from the Aimeos company:
https://aimeos.com/support
Code: Select all
return [
'site' => [
'manager' => [
'decorators' => [
'local' => ['Myproject']
]
]
]
];
Code: Select all
return [
'locale' => [
'manager' => [
'site' => [
'decorators' => [
'local' => ['Myproject']
]
]
]
]
];
https://aimeos.com/support
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star