To accomplish this you will need to do a template override. I suggest you read my blog post about Joomla template overrides if you are unfamiliar with the concept.
Joomla template overrides to the resque
The file you need to modify is:
/templates/YOURTEMPLATE/html/com_content/article/form.php
If the file doesn't exist in your template html folder, you need to copy it from the Joomla core folder, namely:
/components/com_content/views/article/tmpl/form.php
In this file, you will find the following code (I've added some whitespace to make it easier to read):
<tr>
<td class="key">
<label for="state">
:
lists['state']; ?>
</td>
</tr>
<tr>
<td width="120" class="key">
<label for="frontpage">
:
lists['frontpage']; ?>
In front of this code, enter this:
user->authorize('com_content', 'publish', 'content', 'all')) : ?>
after the code, you enter:
These are PHP code snippets which will show the labels and radio buttons for the 'Publish' and 'Show on Front Page' functions only of the user has the required access level (Manager or above).
Which means you end up with a section in your file looking like this:
user->authorize('com_content', 'publish', 'content', 'all')) : ?>
<tr>
<td class="key">
<label for="state">
:
lists['state']; ?>
</td>
</tr>
<tr>
<td width="120" class="key">
<label for="frontpage">
<?php echo JText::_( 'Show on Front Page' ); ?>:
</label>
</td>
<td>
<?php echo $this->lists['frontpage']; ?>
</td>
</tr>
<?php endif; ?>
The result
This is what (part of) the front end editor looked like before the template override:

and this is how it looks without publishing and show on front page capabilities:

Opens lots of possibilities
Use this function to restrict other parts of the edit form as well. You can modify the edit form as you please by using the template override.
Move the settings above the text area, move the button to the end of the form (makes sense, doesn't it?) or perform any other modifications you might want using Joomla template overrides.
Have any other ideas on how to modify the front end editing in Joomla?
Let us know in the comments below!
Want more information like this?
Subscribe to my weekly Joomla newsletter.
When you sign up, you'll get a FREE 52-page ebook: The best of Joomlablogger.net
Written on Thursday, 18 February 2010 13:30
by
Kristoffer Sandven, JoomlaBlogger
Viewed 14206 times so far.
blog comments powered by Disqus
Joomlablogger.net is hosted by Rochen:




Comment Rules: Critical is fine, but if you're rude, I'll delete your stuff. Please do not put your URL in the comment text unless it's relevant to the post and please use your PERSONAL name, blogger name or initials and not your business name, as the latter comes off like spam. Have fun and thanks for adding to the conversation!