2012-10-23 60 views

回答

1

如果你不想使用菜單,然後在您的自定義頁面使用查詢: -

<?php 
$db = &JFactory::getDBO(); 
$query = "SELECT id, title FROM #__content WHERE state = '1' ORDER BY ordering"; 
$db->setQuery($query); 
$rows = $db->loadObjectList(); 
?> 
<select id="s_articles" name="s_articles"> 
<?php foreach ($rows as $row) {?> 
<option <?php if ($row->id == $value) { echo " selected=\"selected\""; } ?>value="<?php echo $row->id;?>" > 
<?php echo $row->title;?> 
    </option> 
<?php }?>