- Posts: 10
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Disable "featured" for registered users when adding items
Disable "featured" for registered users when adding items
- Enrico Ardito
-
Topic Author
- Offline
- New Member
Thanks.
Please Log in or Create an account to join the conversation.
- rexkramer
-
- Offline
- Senior Member
- Posts: 71
Please Log in or Create an account to join the conversation.
- Josh
-
- Offline
- Senior Member
- Posts: 63
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
You can do this by copying 'components/com_k2/views/item/tmpl/form.php' to 'templates/YOUR_JOOMLA_TEMPLATE/html/com_k2/item/form.php'.
Joomla & K2 will auto load this file instead of the original K2 file when a user will add an article in frontend. Just edit this file and delete featured code.
Olivier
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
$user = &JFactory::getUser();
if ($user->gid >23) { //user is admin
//Featured code
}
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
By copying the file and modifying the one in your Joomla template, you won't be worried by K2 updates...
Olivier
Please Log in or Create an account to join the conversation.
- Scott Osteen
-
- Offline
- New Member
- Posts: 15
and then add the code listed below?
And where do insert this code?
Olivier Nolbert said:You can do that with this piece of code :
$user = &JFactory::getUser();
if ($user->gid >23) { //user is admin
//Featured code
}
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
That"s exactly what you have to do...
In 2.3, the code is @lines 293-294
Just have to put these 2 lines between your test...
Olivier
Scott Osteen said:I'm a bit of a newb, but i think i can do this. Do I first copy 'components/com_k2/views/item/tmpl/form.php' to 'templates/YOUR_JOOMLA_TEMPLATE/html/com_k2/item/form.php'. and then add the code listed below?
And where do insert this code?
Olivier Nolbert said:You can do that with this piece of code : $user = &JFactory::getUser();
if ($user->gid >23) { //user is admin
//Featured code
}
Please Log in or Create an account to join the conversation.
- Scott Osteen
-
- Offline
- New Member
- Posts: 15
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Here's the modified form.php
Olivier
Please Log in or Create an account to join the conversation.
- Scott Osteen
-
- Offline
- New Member
- Posts: 15
Olivier Nolbert said:Scott,
Here's the modified form.php
Olivier
Please Log in or Create an account to join the conversation.
- Paul
-
- Offline
- Senior Member
- Posts: 58
Thanks for this post, useful but i do not have a FORM.PHP file in that directory you stated earlier
Paul
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Just check your installation (reinstall K2).
You should have this file in the specified folder.
Be careful, the form.php i've given is for K2 2.3, i'm not sure it'll work with 2.4
Olivier
Paul said:
Hi Scott
Thanks for this post, useful but i do not have a FORM.PHP file in that directory you stated earlier
Paul
Please Log in or Create an account to join the conversation.
- Paul
-
- Offline
- Senior Member
- Posts: 58
Paul
Olivier Nolbert said:
Hi Paul,
Just check your installation (reinstall K2).
You should have this file in the specified folder.
Be careful, the form.php i've given is for K2 2.3, i'm not sure it'll work with 2.4
Olivier
Paul said:
Hi Scott
Thanks for this post, useful but i do not have a FORM.PHP file in that directory you stated earlier
Paul
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Disable "featured" for registered users when adding items