Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2569

General Questions/New to Joomla! 4.x • Re: How to make the alias field non-editable in the article editing form?

$
0
0
Welcome to the Joomla forum!

Go to System - Templates - Administrator Templates and click 'Atum Details and Files'. Go to tab 'Create Overrides' and select Layouts. Select 'joomla' and click 'edit'. Now you will see the message "Override created in /administrator/templates/atum/html/layouts/joomla/edit".

This is how the Alias field is made non-editable to all users: go to the Editor tab, edit the file administrator/templates/atum/html/layouts/joomla/edit/title_alias.php and remove lines 22 to 24, shown below, then save the file:

Code:

    <div class="col-12 col-md-6">        <?php echo $form->renderField('alias'); ?>    </div>
If only Super Users should be able to edit the Alias field, replace all the code in the layout override file title_alias.php with the following code and save & close the file:

Code:

<?php/** * @package     Joomla.Site * @subpackage  Layout * * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license     GNU General Public License version 2 or later; see LICENSE.txt */defined('_JEXEC') or die;use Joomla\CMS\Factory;$app= Factory::getApplication();$user= $app->getIdentity();$form  = $displayData->getForm();$title = $form->getField('title') ? 'title' : ($form->getField('name') ? 'name' : '');?><div class="row title-alias form-vertical mb-3">    <div class="col-12 col-md-6">        <?php echo $title ? $form->renderField($title) : ''; ?>    </div><?php   if ($user->authorise('core.admin')) { ?>    <div class="col-12 col-md-6">        <?php echo $form->renderField('alias'); ?>    </div><?php    } ?></div>

Statistics: Posted by toivo — Fri Jan 05, 2024 12:40 am



Viewing all articles
Browse latest Browse all 2569

Trending Articles