Cara membuat menu sendiri di Navigation bar magento
Cara 1 : (lebih sering edit file top.phtml utk tambah menu lagi)
Setelah membuat halaman baru di CMS-Page (ex:test1), lalu:
1. Edit file top.phtml
2. Tambahkan baris*: < li > < a href="<?php echo $this->getUrl('test1')?>"><?php echo $this->__('Staff') ?></a></li>
ini codingnya:
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php echo $_menu ?>
*disini
</ul>
</div>
<?php else: ?>
3. refresh browser, muncul de menu Staff.
4. selesai.
==============================
Cara 2: (hy 1x edit file top.phtml, setelah itu tinggal tambahkan di content block utk menambah menu baru lagi)
Setelah membuat halaman baru di CMS-Page (cth:tes1), lalu:
1. Buat Static Blocks di CMS-Static Blocks (cth:mymenu).
2. Edit file top.phtml.
3. Tambahkan baris*: <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('mymenu')->toHtml(); ?>
ini codingnya:
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php echo $_menu ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('mymenu')->toHtml(); ?>
</ul>
</div>
<?php else: ?>
4. Di Static Blocks Contents tambahkan baris:
<li>
<a title="title goes here" href="{{store direct_url="test1"}}">
<span>Staff</span>
</a>
</li>
5. klik Save Block.
6. refresh browser, muncul de menu Testing.
7. selesai.
No comments:
Post a Comment