Thiết kế Template cho Joomla 1.5 (phần 6 - nhúng mã Joomla)
Posted on April 19, 2008
by Blog.thegioiwebsite.Net Thiết kế web với Joomla |
Joomla! xây dựng một loại thẻ riêng cho việc thiết kế Template, đó là thẻ <jdoc>. Thẻ <jdoc> được dùng để nạp các phần tử riêng biệt của Joomla, chẳng hạn như: Nạp phần Head, nạp các Module, nạp các Component.
Thẻ này được khai báo như sau:
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
<jdoc:include type="[head|module|component]" />
Bây giờ hãy mở file "index.php" của template và nhúng vào các đoạn mã của Joomla!
Bước 6.1: Nhúng đoạn mã nạp phần HEAD:
<head>
<jdoc:include type="head">
</head>
Bước 6.2: Nhúng các đoạn mã để nạp MODULE và COMPONENT:
Thay |-TOP-|, |-USER3-|, |-USER4-|...

bằng các đoạn mã giống như hình dưới:

Hoặc copy đoạn mã đầy đủ sau
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
<html>
<head>
<jdoc:include type="head">
</head>
<body>
<div id="top"><jdoc:include type="modules" name="top" /></div>
<hr />
<div id="user3-user4">
<div id="user3" style="float:left; width:350px;"><jdoc:include type="modules" name="user3" /></div>
<div id="user4"><jdoc:include type="modules" name="user4" /></div>
</div>
<hr />
<div id="main">
<div id="left" style="float:left; width:150px;"><jdoc:include type="modules" name="left" /></div>
<div id="component" style="float:left; width:250px;"><jdoc:include type="component" /></div>
<div id="right"><jdoc:include type="modules" name="right" /></div>
</div>
<div style="clear:both;"></div>
<hr />
<div id="footer"><jdoc:include type="modules" name="footer" /></div>
</body>
</html>
Bước 6.3: Kiểm tra kết quả
Mở Website của bạn và kiểm tra kết quả:
Comments
One Response to “Thiết kế Template cho Joomla 1.5 (phần 6 - nhúng mã Joomla)”
Leave a Reply
Thẻ div trong html có tác dụng gì vậy bạn