the standard “welcome”-Message from Magento is known for a long time. It is usually displayed at the top in the header and often disappears again.
But if you want this “welcome”-Message not in the header but at a desired location e.g.. have on the home page, is this not so easy but-if you know how- but rel. quickly.
- If you create a file e.g.. with the name “welcome-cms.phtml” im Ordner app / design / frontend /[Eigenes Theme]/[Eigenes Theme]/template/page/html
- Here you copied purely following code:
<div> <p class="welcome-cms"><?php if (empty($this->_data['welcome'])) { if (Magus::isInstalled() && Magus::getSingleton('Customer / session')->isLoggedIn()) { $this->_data['welcome'] = $this->__('Welcome, %s!', $this->escapeHtml(Magus::getSingleton('Customer / session')->getCustomer()->getName())); } else { $this->_data['welcome'] = Mage::getStoreConfig('design/header/welcome'); } } echo $this->_data['welcome']; ?></p> </div>
- Saving, Upload. With this code, the default welcome text appears a non-logged-in visitors now, the one in the backend under System > Configuration > Design > “Visible head area” – “welcome text” can enter. If the user is logged but, will give him “Welcome, [his name]” displayed. This can now be adjusted directly in the file or about the translation. This was with us in the page.csv be found in app / locale / en_US and there as “Welcome, %s” guided.
- Now in the desired CMS page, the variable
{{block type="page/html" template ="page/html/welcome_cms.phtml"}}
inserted.
- Last must now (Magento >= 1.9) the authorization are set for the block. This is done by subjecting System > permissions > Blocks makes a new entry and “page/html” allowed.
- Now, in the front end, the welcome message should appear beautiful. It can now be mockup directly from the admin or via the CSS with the class “.welcome-cms”
Used in Magento Version 1.9 Comments? Additions? Notes? Gladly!