I’m trying to get a “welcome” banner to appear on the home page. I want the two columns, with the sidebar, but I want my banner to span the width of the page. The problem is that there’s no easy way to do so via the Magento home page editing interface - it doesn’t clear the right column.
I don’t need my users to be able to change this, really. I just want to detect if we’re on the home page or not from page/2columns-right.phtml, I’m thinking. I’ve looked around a bit, but I can’t figure out how to write a conditional that simply asks if that’s the current page or not.
1. Create a CMS block with HTML content of your banner and give it identifier “home_banner”
2. Edit 2columns-right.phtml and add <?=$this->getChildHtml('banner')?> where you’d like it to be.
3. In Home CMS page edit “Custom Layout Update”:
One point I am unclear on: in step 3, where exactly am I putting that code? I can’t figure out what you mean by “In Home CMS page edit Custom Layout Update.”
It seems like that’s an update to an XML file, but I’m not sure if that’s what you mean.
Thanks again. Unfortunately, I’ve triple-checked my work, but it’s still not working. I even tried changing the reference to “top_banner” in your XML to “home_banner”, just be be sure it wasn’t a random typo. Looks like it wasn’t!
I’ll keep plugging away, and if I stumble across the answer, I’ll be sure to post it here.
No, I have all caching off in Magento, since I’m working on the layout and templates right now. But I did force them to clear, just in case there was some weirdness there. But alas, nothing weirder than usual.
When I preview the home_banner page, at /index.php/home_banner, I do see the banner image just fine.
When I preview (or normally view) the home page, it’s not there - no trace in the source or anything.
The concept I’m seeing is very interesting - that you can change the page layout from within a constituent piece of HTML by adding Layout XML. Note that this template, and all of my templates, are not in the ‘default’ interface, they are in a ‘custom’ interface that I’m working from. I think I’ve got those concepts right, and haven’t had any trouble with that up to now. But I was thinking that perhaps adding that XML to the home page might require some adjustment for this reason.
I will keep looking for a way to get this to work!
Lets say.. i wanted something more like… “header_links” to populate into a child phtml file from the admin CMS/Static blocks area.
(to match the functionality of footer links)
Instead of putting it directly into each parent phtml file (one column, 2 column, etc.) I am looking to keep it in the child header.phtml that they refer to as it will be on every page.
I plan to keep it inside of the <div class="header-nav"></div>
What would the referencing be then in:
the Child phtml file
and the static block.
When you edit the CMS Page, right under Content textarea you should have Custom Layout Update textarea.
Hi.
In reference to above, there is NO Custom Layout Update textarea under Content textarea (please refer to the screenshot). Can anyone please help me out taking my first step. I’m using v1.0. Thanks.
is it possible to put a static block to a specified position in a phtml?
i am trying to write an own module to manage servicestuff and would like to have a text block above my form.
i were able to have the static block parsed below my formular or above the page-head, but not at the correct position, seems its controlled by the xml - i were also able to delete the getChildHtml part and the text was in my browser aswell…
Thanks for any hint.
Alanin // Joerg
my *.phtml:
<div class="page-head"> <h3><?php echo $this->__(' Header of my Page') ?></h3> </div> <?=$this->getChildHtml('textVorabtausch')?> <form action="<?=$this->getFormAction()?>" id="registerForm" method="post" enctype="multipart/form-data">...
I’m having a hard time getting flash to render from my homepage. I followed the instructions and it render the block but not the flash fully. It renders the right size and the runactivecontent.js is recognized.
Its just blank but the actual swf file renders fine from its location within a sub directory on the root level /flash/
This flash does use an XML file to pull JPG images into the flash. (slideshowpro)
On an important side note, how can I create a conditional static block? I need this static block to display on the homepage but every sub page it will be replaced with a static JPG half the height.
1. Create a CMS block with HTML content of your banner and give it identifier “home_banner”
2. Edit 2columns-right.phtml and add <?=$this->getChildHtml('banner')?> where you’d like it to be.
3. In Home CMS page edit “Custom Layout Update”:
as it doesn’t interpret it, and output on front-end exactly. My question, is how to include an image in the custom CMS block, indicating the correct path with getSkinUrl?
Hi ya,
I would like more help with knowing which tags you can place in to static blocks. Perhaps someone could prodce some examples? I did figure out that you can put an image in a static block by using the following syntax: