Sometimes, I would like to restrict the way the Joomla front end editing works. More specifically, I want to restrict access to some of the features in the front end editing.
On one site I work on, I've restricted access to the 'Publish' and 'Show on Front Page' buttons. For this particular site, I want local editors of an organization to be able to enter new articles, and to edit the published articles. I don't want the local editors to be able to publish to the front page. This is something the editor-in-chief should do. Thus, this function needs to be removed from the front end editor.
I did this by editing the form page used to edit articles.
If you know some HTML and can read PHP you can remove / comment out the parts of the file you don't want the users to see. This will happen for all users without administrator privileges, though. I've put together a modification which removes the radio buttons for 'Publish' and 'Show on Front Page' if the user belongs to a lower access level groups than 'Manager'.
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 get free, weekly Joomla tips, tutorials, news and special offers!
Written on Thursday, 18 February 2010 14:30 by Kristoffer Sandven, JoomlaBlogger
Viewed 3776 times so far.
Like this? Tweet it to your followers!
blog comments powered by Disqus
Subscribe to JoomlabloggerGet tips, news and tutorials via RSS, Email or Twitter
Donate to support this blog
If you learn something from this blog, feel free to support my efforts by donating any amount below.
To all of you already supporting my blog,
thank you so much!
Popular
Video: K2 version 2.3 released
(Joomla Extension News)
JoomlaWorks just released version 2.3 of their free CCK component for Joomla: K2. The new...
Tutorial: How to understand Joomla templates in five easy steps
(Joomla template tutorials)
Open Source Training has been teaching people how to learn Joomla for several years now...
FLEXIContent 1.5.3 announced, includes front-end editing
(Joomla Extension News)
As you might have read in my post about FLEXIcontent earlier today, I was hoping for...
Video: Impressions from «J and Beyond 2010»
(Joomla events)
As you know, I spent 4 days in Germany to attend the Joomla! conference «J and Beyond...
How to do keyword research with Market Samurai
(Joomla SEO)
If you have a Joomla website, you probably want it to be visible in the search engines....
Latest
Joomla Blog Posts from Around the Web (week 29)
(Joomla news)
Here are some interesting Joomla blog posts I found during week 29. Enjoy! ...
7 blog posts you should have read
(Joomla evangelism)
There are a lot of posts on this blog now, and many of them are hidden in the depths of...
Meet a Joomla user: Hils Cheyne
(Interviews)
This week, you'll meet Hilary "Hils" Cheyne. She's a British web developer and an...
people.joomla.org reached 4000 members, meet Mary Mar from Brazil
(Joomla news)
The Official Joomla Community site was launched earlier this year. Yesterday, the site...
Joomla Blog Posts from Around the Web (week 28)
(Joomla news)
Here are some interesting Joomla blog posts I found during week 28. There's a post on how...
Random
Buy a Quick Look listing on Joomlablogger.net
(About)
There are literally thousands of Joomla! extensions and templates available online. How will users find yours? Quick Looks are a way for you as a...
Joomla! CMS 1.5.11 security release available
(Joomla news)
The Joomla Project announces the immediate availability of Joomla 1.5.11 [Vea]. This is a security release and users are strongly encouraged to...
Join the 2010 CMS Expo in Chicago
(Joomla news)
CMS Expo is a 3-day conference for web pros in business, education, government and the non-profit world. Web Designers, Developers and Business...
Simple Shop Remix - Joomla Template for FoxyCart
(Joomla news)
Simple Shop Remix, a recently released template from JoomlaPraise, is the easiest shopping cart in Joomla! Simple Shop Remix combines the best...
Latest Quick Looks
Quick Look posts are paid submissions offering only a brief overview of a Joomla! template or extension. Vote if you think this software is worth an in-depth review here at JoomlaBlogger.net!
Buy a Quick Look



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!