call different phtml file from cms in different website - magento

I am using CMS/pages in magento. I am calling phtml file from cms/pages/homepage.
CMS pages is common for all the websites that are created in that system. (I guess correct me if i am wrong)
How can i call different phtml files based on which website is loaded ?

You can create different CMS pages for different store views (and thus websites). Check the Magento wiki if you don't know how to work with it's admin panel.

Related

where can i find view html pages in magento?

I went through the project structure of magento ,but couldn't find the view pages.
I am zend MVC developer and new to magento.
where can i find the router page and html pages for view?
Magento 1 makes use of themes for frontend views, and layouts. Magento provides a set of base template files, that provide the default information and layout for pages. These can be found within /app/design/frontend/base/default/template/. Theme fallback allows for you to create and configure a separate theme folder, i.e. /app/design/frontend/mypackage/mytheme/template/ and only override the files you require.

Building Magento - how to keep code and CMS in sync

We are developing with Magento 1.7.0.2, we are having problem of keeping our code and our CMS page in sync. Let say I have a branch that task include
Create a new CMS page
Use jQuery slider to display products on this new CMS page
We create a new CMS page in Magento admin. We then add jquery.js and js for slider, and write js function to slide all products inside the main div of the new CMS page. However, when we check code into our branch, we only able to checkin the js files. So people are assigned to review this task, they only able to pull the js code, but not the CMS page, which I think locate inside the database. Therefore, they are unable to test, since I dont have the CMS page. I am thinking of couples way:
Passing the db around. This is not a solution, because it is big, and will take long time to import.
point db connection in app/etc/local.xml to the remote db that contain the CMS page. Also not a valid solution, because magento store url in database under web/unsecure/base_url. So I will always get redirect to the other machine ip address instead of my local ip address.
So how do I resolve this issue? What are industry accepted method for this?Please help? THank you very much
Did you try to place full content outside of block code and use only its template?
Let's say you have static page 'Slider-2014'. In WYSIWYG editor you place
{{widget type="cms/widget_block" template="customjs/slider-2014.phtml"}}
In app/design/frontend/base/default/template/ create folder 'customjs'
In folder customjs create file slider-2014.phtml and place anything you need to show in slideshow:
<div class="slider"></div>
Clear cache if needed. Then reload /slider-2014.html page and you'll get all content from that file. Now you can share folder customjs

Create admin front with a simple form via a module [Magento]

I am pretty new to Magento and am trying to understand how to create admin (backend) page. I have figured how to create/define the controller and action (along with editing the config.xml).
But now the next problem at hand is to display a simple form in that page. I understand that, I have an option to create blocks and mention the blocks in a layout.xml. But from what I figure is that layout.xml needs to be present in the theme folder. Which I can't do as my magento extension will be installed and I have no access to the user's system.
So the doubt is. How to display a simple from in a backend (admin) page
without having to make any changes to the theme's layout ?
For the admin panel module you don't need to mention the block in the layout.xml of your theme, you only need it to be defined in config.xml file in your "app/code/local///etc/" and a layout file is created in "app/design/adminhtml/default/default/".inside the Block create a folder named "Adminhtml" inside it your can create your form.
Refer this
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/how_to_create_an_admin_form_module

Where does Magento 1.6 Store its CMS Page?

I was looking around the admin panel of magento, and I came across the cms menu, which has a pages section. I was not able to locate that pages listed in this section in Magento's file directory structure. Where can i find all the cms pages, especially the home page?
Magento's pages aren't files on the server. They're stored in the database. In the stock installation you'll find their content in the cms_page table.

How can i override the default magento cms homepage entry with a custom module?

I am currently attempting to use a custom module as the first page when you hit the magento installation, i currently have {{block type="namespace_module/block" template"path/to/template.phtml"}} located within the home page cms entry, but unfortunately it is not calling the template or the module which i am requesting, i am now looking at trying to find out if its possible to use a custom module (controlled by indexController.php) to take precidence over the cms home page entry.
This has two reasons behind it, reason 1, it will give me more flexibility for me to extend the index page, and 2, it will allow me more flexibility over css/js which i want to include on that specific page.
If anyone knows of a solution to getting a custom module to take precidence over the cms home page it would be a huge help to myself and the community at large as many people are un-aware of how this is achieved.
Thanks for any assistance provided.
Ryan
If you have a custom controller then put it's frontname/controller/action path in System > Configuration > Web > Default Pages > Default Web URL.

Resources