- Posts: 26
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Seeing unpublished items when logged in front end
[SOLVED] Seeing unpublished items when logged in front end
- Dave Sage
-
Topic Author
- Offline
- Junior Member
Had a surprise that I couldn't see unpublished items in the front end when logged in as an admin. This is standard within normal Joomla article flow, so people can edit the articles in the front end and then publish them. Is this missing feature likely to be added to K2?
Cheers,
Dave
Please Log in or Create an account to join the conversation.
- jeff vandenberg
-
- Offline
- New Member
- Posts: 1
Is there any plans for allowing unpublished to be viewed in some way on the front end? Is there a way to do it that I am just not seeing?
Thanks,
Jeff
Please Log in or Create an account to join the conversation.
- Nicolas
-
- Offline
- New Member
- Posts: 10
Need the same thing here !
It's very weird that a user (manager for example) can't see all the unpublished K2 item in frontend for managing them.
Please Log in or Create an account to join the conversation.
- Mhamed Lahmar
-
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- TalkEZY.com
-
- Offline
- New Member
- Posts: 4
I'm having the same issue here I had to create an new ACL as awork around and set new things to publish to that group... thats not good K2
:ohmy:
Please Log in or Create an account to join the conversation.
- george
-
- Offline
- New Member
- May The Force be with you.
- Posts: 12
Open components/com_k2/models/itemlist.php
Around line 339 under this line
JPluginHelper::importPlugin('k2');
put this code
// Lollypop.gr fix
$lollygroups = array();
foreach ($user->groups as $key => $value){
$lollygroups[] = $key;
}
if(in_array(3,$lollygroups) OR in_array(8,$lollygroups)){
$query = str_replace("i.published = 1 AND","",$query);
}
// EOF lollypop.gr fix
So with this hack allow Admins and authors to view Un-bpublished items in category listings. The ID's 3 and 8 are for Authors and Superadmins in a default Jinstallation. You can put many more if you like other groups to see this as well.
Also in the overridden view file /templates/templatename/html/com_k2/default/category_item.php
around line 54 add this line, so you can see what articles are un-published
<?php if($this->item->published==0) {?><span><sup>Unpublished</sup></span><?php }?>
And at last, in order to see the un-published item you do something similar.
open /components/com_k2/views/item/view.html.php and around line 106 replace this
if (!$item->published || $item->trash)
{
JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
}
with this
// Published check
//
if (!$item->published){
// Lollypop fix
$lollygroups = array();
foreach ($user->groups as $key => $value){
$lollygroups[] = $key;
}
if(!in_array(3,$lollygroups) AND !in_array(8,$lollygroups)){
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
return;
}
// EOF lollypop
}
if ($item->trash)
{
JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
}
It worked perfect for me.
Please Log in or Create an account to join the conversation.
- Jay Reeves
-
- Offline
- New Member
- Posts: 5
However when the unpublished article is viewed on the frontend, it will say "Published in..." even though it's not published. It makes it hard to tell what is and is not published, without knowing firsthand.
I think this is a very serious flaw or oversight on the K2 developers part.
I like a lot of the features the K2 brings, but there are places the Joomla core still smokes. Here are some issues I see that K2 could correct to make it rock:
1) the K2 frontend editor window does not close automatically on a save and return you to the page you started from - you have to close it (there's been reports of conflicts with JQuery, but I can't find that occuring on a site I have)
2) K2 Items created on the frontend by an author, cannot be easily edited and published via the frontend by anyone else, even SU.
3) When a K2 item is created on the frontend by an author, there is no notification anywhere to anyone. Joomla can send an email notification - very nice!
I'm at the point to where K2 is going to be ripped out of my sites - the above items are deal breakers for me.
Please Log in or Create an account to join the conversation.
- hibrix
-
- Offline
- New Member
- Posts: 2
thanks in advance,
Please Log in or Create an account to join the conversation.
- Cody
-
- Offline
- New Member
- Posts: 1
Please Log in or Create an account to join the conversation.
- george
-
- Offline
- New Member
- May The Force be with you.
- Posts: 12
Jay Reeves wrote: However when the unpublished article is viewed on the frontend, it will say "Published in..." even though it's not published. It makes it hard to tell what is and is not published, without knowing firsthand.
I am not sure I understand your point. Did you used the template hack? Its easy to see what is unpublished because of the
<?php if($this->item->published==0) {?><span><sup>Unpublished</sup></span><?php }?>
You can use some css to the span element to make it even more clear. So you just ignore the "Published in..." line and check for this span in the listing.
Again I say, this is not the best way to go, but sure its a hack to bypass this problem. The un-cool side of hacks is that you must do this in each and every upgrade. Hope someone from the DEV team to look for this issue.
Please Log in or Create an account to join the conversation.
- mili
-
- Offline
- New Member
- Posts: 8
Please Log in or Create an account to join the conversation.
- Luca
-
- Offline
- New Member
- Posts: 3
is this hack still valid?
I tryed to apply at my website, but what happens is I can see the unpublished items, but they are under the category selected when the Editors send items.
I attach a print screen in which is present an unpublished item under category "Serie C1"
I've used a menù link loaded with "latest Items from "Users or Categories".
Please let me know where I'm wrong!!!!
Thanks
Please Log in or Create an account to join the conversation.
- Luca
-
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- Domenico F.
-
- Offline
- New Member
- Posts: 6
Is there a way to see also the articles with a start date in the future?
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
K2 allows you to see all your items when you are logged in, in the front-end and you are viewing your page. This applies also for items with a future start date.
Please Log in or Create an account to join the conversation.
- Dave Sage
-
Topic Author
- Offline
- Junior Member
- Posts: 26
Question though, @Lefteris you say K2 allows you to see all your items...
Do you mean on the users blog page? The thing is our site has multiple front end publishers and they need to see each others items, it is also not intuitive to look at a users blog page to edit items from specific categories. The whole ease of use is to say navigate to the place in the website and edit or add your items. i.e. if you want to edit/add news then the front-end user navigates to the news category page and erdits/adds items.
The category pages don;t show un-published items.
I find it a bit strange because native Joomla Articles have always been shown in their category pages and the user can easily spot that they are un-published.
I hope V3 brings back this intuitive behaviour.
Cheers,
Dave
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
It brings the entire backend functionality in the front-end.
Please Log in or Create an account to join the conversation.
- Dave Sage
-
Topic Author
- Offline
- Junior Member
- Posts: 26
Cheers,
Dave
Please Log in or Create an account to join the conversation.
- Daniel Alves da Cruz
-
- Offline
- New Member
- Posts: 1
Set Guest user group parent to publish.
Set Guest access level to Guest User Group.
In the options of user component set the Guest User Group to Guest.
I hope it's help.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Seeing unpublished items when logged in front end