简体   繁体   中英

add link next to label of joomla 2.5 registration xml

i need to add a link next to the label (or in the label) of all the fields. i have placed my xml for the name field below (it should be simple to extend it to the others). eg next to name it should have an html link. can't get it to work though. please help

here's my xml:

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

        />

and here's my 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>
            <div style="margin-bottom:8px;">
                <?php echo $field->label; ?><a href="index.php">Link</a>   
            </div>

You should be able to just add it as part of this section of code like the above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM