Simple way for a store view distribution page
문제
We have an international store and the option to include the store view URL, i.e. URLs like
When the user opens, http://www.example.com/ we want to show an entry page with links to the different countries.
How to accomplish that?
My current approaches:
Create an additional store view "landing", edit the CMS page "home" (I think I would need some tweaks to show this store view under the
/
URL)Or set the setting
web/default/cms_home_page
globally to a CMS page, lets say "landingpage". Overwrite it in the real stores.???
Edit - additional: In our case we also use the "default" site as a template (for CMS pages) which we copy to the different countries - so this site is kind of impossible to use in production.
Edit - see @kalenjordan commeting on my Answer
해결책 4
That is my final solution based on the community answers:
- Create global_website and store code:
global
- Create CMS page
home
in Global Website - Change
MAGE_RUN_CODE
env variable in vhost or .htaccess. Alternative inindex.php
, change default store code toglobal
($mageRunCode = 'global'
) - Add Layout updates for the handle
STORE_global
to remove unneeded parts of the layout (for example the main menu)
Disclaimer:
Changing the index.php
can lead to complications, you have to be careful during updates to merge your changes properly.
다른 팁
This is how I'd do it:
- Base url
example.com
(root, no language selected) would be the 'default' site as installed by Magento, i.e. the one with the store code 'default'. - The homepage for
default
is your 'select a store' gateway CMS page - That links to the subdirectories, which are physical directories in the webroot that have symlinked
media
,skin
,js
directories; index.php is a separate file that references../app/Mage.php
instead ofapp/Mage.php
- The htaccess in subdirectories will define the store and run codes
Ideally your default site's root catalog is empty. The CMS homepage's custom layout xml could remove things like nav, header, footer. You could also have some customization in index.php to check for a store
cookie so as to push them to their preferred site on future visits instead of requiring them to step through the language/locale gateway.
I would go with 1st approach. In a meanwhile you may want to add more pages irrelevant to any of localised store views or make some other customisations. This approach will give you a bit more flexibility.
A third option would be to rewrite the url http://www.example.com
to the homepages or a different CMS page on any of the stores. So http://www.example.com
would be rewritten to http://www.example.com/us/landing.html
.
I've never tried it before but it should basically work. Magento would pick up on the full URL and process it as a normal CMS page