How to setup a second site

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

How to setup a second site

Post by cnoelker » 07 Apr 2020, 12:09

Hello,

I read the (sparse) documentation about the sites on https://aimeos.org/docs/User_Manual/Adm ... with_sites , but this doesn't answer all questions in my mind:

* "The easiest way is to run the setup/update script and passing a new site code." -> Is this the script call?
typo3cms aimeos:setup mysecondsite

* For creating the page tree, the site name needs to be set with tx_aimeos.mshop.locale.site . Correct?

* The second site will have the same layout like the first (=default) site. They will have different products. Also, they will have different functionality in the cart and detail pages. All of this is currently implemented in my own extension, which I then added ("include static") in the template. My idea now is to create another extension for the second site, put the changes in this one and then add both the initial and the second extension as include static in the second site. Is this the recommended way?

* In the admin area, I can provide options and values for the site. What are these options for?

Claudia

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: How to setup a second site

Post by aimeos » 08 Apr 2020, 17:42

cnoelker wrote: 07 Apr 2020, 12:09 * "The easiest way is to run the setup/update script and passing a new site code." -> Is this the script call?
typo3cms aimeos:setup mysecondsite
Yes
cnoelker wrote: 07 Apr 2020, 12:09 * For creating the page tree, the site name needs to be set with tx_aimeos.mshop.locale.site . Correct?
Yes, as PageTS to show the right categories and attribute type in the flexforms
cnoelker wrote: 07 Apr 2020, 12:09 * The second site will have the same layout like the first (=default) site. They will have different products. Also, they will have different functionality in the cart and detail pages. All of this is currently implemented in my own extension, which I then added ("include static") in the template. My idea now is to create another extension for the second site, put the changes in this one and then add both the initial and the second extension as include static in the second site. Is this the recommended way?
Yes, should work well.
cnoelker wrote: 07 Apr 2020, 12:09 * In the admin area, I can provide options and values for the site. What are these options for?
All or nothing. It depends what you are doing in your code with it
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: How to setup a second site

Post by cnoelker » 09 Apr 2020, 07:29

Thanks for confirming my assumptions. I will try this out.

Concerning my last question, about the config options for the site: Do you have some examples for typical use cases? And how can I access the entered values programmatically? I would like to get an idea how to make use of this.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: How to setup a second site

Post by aimeos » 10 Apr 2020, 12:47

You could use them for settings specific for that site if you don't want to configure them globaly via TS or in the php config files. To access the key/values pairs, you should use:

2019.x:

Code: Select all

$context->getLocale()->getSite()->getConfigValue( 'key', '<default>' );
2020.x

Code: Select all

$context->getLocale()->getSiteItem()->getConfigValue( 'key', '<default>' );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: How to setup a second site

Post by cnoelker » 14 Apr 2020, 07:31

Thanks a lot!

Post Reply