2013-03-06 39 views
0

我需要在所有字段的標籤(或標籤)旁邊添加一個鏈接。我已經把我的xml放在下面的名稱字段中(將它擴展到其他的應該很簡單)。例如在名稱旁邊應該有一個html鏈接。不能讓它工作。請幫助在joomla標籤旁添加鏈接2.5註冊xml

,這裏是我的xml:

<field name="name" type="text" 
      description="" 
      filter="string" 
      label="Full Name" 
      message="COM_USERS_REGISTER_NAME_MESSAGE" 
      required="true" 
      size="30" 
         class="signupbox" 

     /> 

,這裏是我和registration.php

<?php 
/** 
* @package  Joomla.Site 
* @subpackage com_users 
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 
* @license  GNU General Public License version 2 or later; see LICENSE.txt 
* @since  1.6 
*/ 

defined('_JEXEC') or die; 

JHtml::_('behavior.keepalive'); 
JHtml::_('behavior.tooltip'); 
JHtml::_('behavior.formvalidation'); 
JHtml::_('behavior.noframes'); 
?> 
<style>.star{display:none;}#recaptcha_table{width: 505px;}input#recaptcha_response_field{;}</style> 
<div style="font-size: 22px;margin-bottom:20px;border-bottom: solid 1px #ddd;padding-bottom: 3px;">Create an account at the Homeovitality Store.</div> 
<div class="registration<?php echo $this->pageclass_sfx?>"> 
<?php if ($this->params->get('show_page_heading')) : ?> 
    <h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1> 
<?php endif; ?> 
<div id="signup-form"> 
    <form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="form-validate"> 
<?php foreach ($this->form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?> 
    <?php $fields = $this->form->getFieldset($fieldset->name);?> 
    <?php if (count($fields)):?> 

     <?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend. 
     ?> 

     <?php endif;?> 
      <div> 
     <?php foreach($fields as $field):// Iterate through the fields in the set and display them.?> 
      <?php if ($field->hidden):// If the field is hidden, just display the input.?> 
       <?php echo $field->input;?> 
      <?php else:?> 
       <div style="margin-bottom:8px;"> 
        <?php echo $field->label; ?>  
       </div> 
       <div style="margin-bottom:20px;"><?php echo ($field->type!='Spacer') ? $field->input : "&#160;"; ?></div> 
      <?php endif;?> 
     <?php endforeach;?> 
      </div> 

    <?php endif;?> 
<?php endforeach;?> 
     <div id="agree-text">By clicking "Create my account" (below), you signify your agreement to the <a href="/legal/terms-and-conditions" target="_blank">terms & conditions</a>, <a href="/legal/disclaimer" target="_blank">disclaimer</a> and <a href="/legal/privacy-policy" target="_blank">privacy policy</a> (including the use of cookies).</div> 

     <div> 


<div style="float:left;"><button type="submit" class="validate" id="createmyaccountbuttonbluelarge"></button></div> 
      <div style="font-size:12px;display:inline-block;margin-left:20px;padding-top: 9px;float: left;"><a href="/store/index.php?option=com_virtuemart&view=category&virtuemart_category_id=1&Itemid=104">Cancel account creation</a></div> 
      <input type="hidden" name="option" value="com_users" /> 
      <input type="hidden" name="task" value="registration.register" /> 
      <?php echo JHtml::_('form.token');?> 
     </div> 
    </form> 
</div> 
</div> 

回答

0
  <div style="margin-bottom:8px;"> 
       <?php echo $field->label; ?><a href="index.php">Link</a> 
      </div> 

你應該能夠只是將其添加爲像這部分代碼的一部分以上。

+0

這將工作的一個標籤,但我有約6個字段在XML – aqibjr1 2013-03-10 16:59:43