更改 joomla 中用户登录的外观

问题描述 投票:0回答:2

我是初学者,不知道如何操作代码。当然,我在这里找到了比我优秀得多的人。我的请求是修改我可用的文件,使它们在 joomla 中正确显示。这是一个登录表单。默认的看起来不太好。请问论坛里有没有人可以帮帮我。我附上 zip 文件夹。非常感谢你

我附上 zip 文件我附上登录表单的 zip 文件

我在这里插入要更改的代码:

我打算更改的代码在这个文件中,该文件只有html代码“index.html”

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="fonts/icomoon/style.css">

    <link rel="stylesheet" href="css/owl.carousel.min.css">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    
    <!-- Style -->
    <link rel="stylesheet" href="css/style.css">

    <title>Charmed login</title>
  </head>
  <body>
  

  <div class="d-lg-flex half">
    <div class="bg order-1 order-md-2" style="background-image: url('images/bg_1.jpg');"></div>
    <div class="contents order-2 order-md-1">

      <div class="container">
        <div class="row align-items-center justify-content-center">
          <div class="col-md-7">
            <div class="mb-4">
              <h3>Sign In</h3>
              <p class="mb-4">Lorem ipsum dolor sit amet elit. Sapiente sit aut eos consectetur adipisicing.</p>
            </div>
            
            
             <!-- Form  --->
            
              <form action="<?php echo Route::_('index.php?option=com_users&task=user.login'); ?>" method="post">
              
              <!-- Username --->
              
              <div class="form-group first">
                <label for="username">Username</label>
                <input type="text" class="form-control" id="username">
              </div>
              
              <!-- Password --->
              
              <div class="form-group last mb-3">
                <label for="password">Password</label>
                <input type="password" class="form-control" id="password">
                
              </div>
              
              <!-- Remember me --->
              <div class="d-flex mb-5 align-items-center">
                <label class="control control--checkbox mb-0"><span class="caption">Remember me</span>
                  <input type="checkbox" checked="checked"/>
                  <div class="control__indicator"></div>
                </label>
                <span class="ml-auto"><a href="#" class="forgot-pass">Forgot Password</a></span> 
              </div>
              
              <!-- Login btn --->

              <input type="submit" value="Log In" class="btn btn-block btn-primary">

              <span class="d-block text-center my-4 text-muted">&mdash; or &mdash;</span>
              
              
              <!-- Social login no --->
              
              <div class="social-login">
                <a href="#" class="facebook btn d-flex justify-content-center align-items-center">
                  <span class="icon-facebook mr-3"></span> Login with Facebook
                </a>
                <a href="#" class="twitter btn d-flex justify-content-center align-items-center">
                  <span class="icon-twitter mr-3"></span> Login with  Twitter
                </a>
                <a href="#" class="google btn d-flex justify-content-center align-items-center">
                  <span class="icon-google mr-3"></span> Login with  Google
                </a>
              </div>
            </form>

            
        
          </div>
        </div>
      </div>
    </div>

    
  </div>
    
    

    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/main.js"></script>
  </body>
</html>

这是com_user的default.php代码:

<?php
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper;
//for_use

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

defined('_JEXEC') or die;

HtmlHelper::_('behavior.keepalive');
HtmlHelper::_('behavior.formvalidator');

?>

<div class="login<?php echo $this->pageclass_sfx; ?>">
    <?php if ($this->params->get('show_page_heading')) : ?>
        <div class="page-header">
            <h1>
                <?php echo $this->escape($this->params->get('page_heading')); ?>
            </h1>
        </div>
    <?php endif; ?>
    <?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
        <div class="login-description">
    <?php endif; ?>
    <?php if ($this->params->get('logindescription_show') == 1) : ?>
        <?php echo $this->params->get('login_description'); ?>
    <?php endif; ?>
    <?php if ($this->params->get('login_image') != '') : ?>
        <img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo Text::_('COM_USERS_LOGIN_IMAGE_ALT'); ?>" />
    <?php endif; ?>
    <?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
        </div>
    <?php endif; ?>
    
    
    <form action="<?php echo Route::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="form-validate form-horizontal well">
        <fieldset>
            <?php foreach ($this->form->getFieldset('credentials') as $field) : ?>
                <?php if (!$field->hidden) : ?>
                    <div class="control-group">
                        <div class="control-label">
                            <?php echo $field->label; ?>
                        </div>
                        <div class="controls">
                            <?php echo $field->input; ?>
                        </div>
                    </div>
                <?php endif; ?>
            <?php endforeach; ?>
            <?php if ($this->tfa) : ?>
                <div class="control-group">
                    <div class="control-label">
                        <?php echo $this->form->getField('secretkey')->label; ?>
                    </div>
                    <div class="controls">
                        <?php echo $this->form->getField('secretkey')->input; ?>
                    </div>
                </div>
            <?php endif; ?>
            <?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
                <div class="control-group">
                    <div class="control-label">
                        <label for="remember">
                            <?php echo Text::_('COM_USERS_LOGIN_REMEMBER_ME'); ?>&nbsp; <input checked="checked" style="display:inherit" id="remember" type="checkbox" name="remember" class="inputbox" value="yes" />
                        </label>
                    </div>
                    <div class="controls">
                        
                    </div>
                </div>
            <?php endif; ?>
            <div class="control-group">
                <div class="controls">
                    <button type="submit" class="btn btn-primary">
                        <?php echo Text::_('JLOGIN'); ?>
                    </button>
                </div>
            </div>
            <?php $return = $this->form->getValue('return', '', $this->params->get('login_redirect_url', $this->params->get('login_redirect_menuitem'))); ?>
            <input type="hidden" name="return" value="<?php echo base64_encode($return); ?>" />
            <?php echo HtmlHelper::_('form.token'); ?>
        </fieldset>
    </form>
    
    
    
</div>

<div>
    <ul class="nav nav-tabs nav-stacked">
        <li>
            <a href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
                <?php echo Text::_('COM_USERS_LOGIN_RESET'); ?>
            </a>
        </li>
        <li>
            <a href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
                <?php echo Text::_('COM_USERS_LOGIN_REMIND'); ?>
            </a>
        </li>
        <?php $usersConfig = ComponentHelper::getParams('com_users'); ?>
        <?php if ($usersConfig->get('allowUserRegistration')) : ?>
            <li>
                <a href="<?php echo Route::_('index.php?option=com_users&view=registration'); ?>">
                    <?php echo Text::_('COM_USERS_LOGIN_REGISTER'); ?>
                </a>
            </li>
        <?php endif; ?>
    </ul>
</div>

我不知道如何处理index.html文件

提前致谢<3

joomla
2个回答
0
投票

只需复制 /components/com_users/tmpl/login/default_login.php 文件并将其放置在 templates/[your-template]/components/com_users/login 下,然后在那里进行修改。逐步进行修改并每次进行测试,以确保如果某个地方出现错误,您不会丢失大量工作。


0
投票

在后台进入 系统 -> 网站模板 -> 选择您的模板 转到“覆盖”选项卡。 单击 com_users 登录时钟 这将在 html/login 文件夹中的模板目录中创建正确的文件。 在这里您可以进行所需的所有更改。

使用此程序您确保

© www.soinside.com 2019 - 2024. All rights reserved.