Keyword

[SOLVED] Seeing unpublished items when logged in front end

  • Dave Sage
  • Dave Sage's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 3 months ago #62864 by Dave Sage
Hi,

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.

More
13 years 3 months ago #62865 by jeff vandenberg
Replied by jeff vandenberg on topic Re: Seeing unpublished items when logged in front end
This is also a non-trivial concern for me as well. I saw the work around suggestion of having an 'unpublished' category that people can post to, but that seemed suboptimal. I do find this to be a flaw in an otherwise very useful package.

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.

More
13 years 1 month ago #62866 by Nicolas
Hi,
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.

More
13 years 2 weeks ago #62867 by Mhamed Lahmar
Replied by Mhamed Lahmar on topic Re: Seeing unpublished items when logged in front end
same problem here...

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #62868 by TalkEZY.com
:angry:
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
  • george's Avatar
  • Offline
  • New Member
  • May The Force be with you.
More
12 years 7 months ago - 12 years 7 months ago #62869 by george
I had the same problem and I did this hack to fix this. Please make sure you have a backup and of course as with all hacks you should do this in each and every upgrade you make. The fix is not the best, but sure its tha fastest way to solve this issue.

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.

More
12 years 5 months ago #62870 by Jay Reeves
Thanks, George, for doing that. It does make the unpublished article appear on the frontend.

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.

More
12 years 5 months ago #62871 by hibrix
i made the hack you suggested but i still retrieve 404 errors when i try to preview unpublished items from the frontend. Any suggestion?

thanks in advance,

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #62872 by Cody
But you can see the unpublished articles! Create a link to the users -userpage(blog)- and the unpublished articles for that user show up in their blog. They can edit the article and publish it from there. It works on my K2 that way anyway. Hope this helps someone. :cheer:

Please Log in or Create an account to join the conversation.

  • george
  • george's Avatar
  • Offline
  • New Member
  • May The Force be with you.
More
12 years 3 months ago - 12 years 3 months ago #62873 by george

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.

More
11 years 10 months ago #62874 by mili
Worked for me tooo. It rocks!!!!

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #62875 by Luca
Hi all,
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
Attachments:

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #62876 by Luca
ok... seems that is working... What I wrong was I displayed only links... and this hack works only with items that are not displayed in links, but with more info!

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #142484 by Domenico F.
I confirm that the fix is working.

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.

More
10 years 2 months ago #142538 by Lefteris
@Domenico F.

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
  • Dave Sage's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 8 months ago #147531 by Dave Sage
Just came back to loook at this thread, some interesting ideas that I need to try.

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 8 months ago #147580 by Krikor Boghossian
Replied by Krikor Boghossian on topic [SOLVED] Seeing unpublished items when logged in front end
Actually V3 brings more than this.
It brings the entire backend functionality in the front-end.

Please Log in or Create an account to join the conversation.

  • Dave Sage
  • Dave Sage's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 8 months ago #147584 by Dave Sage
Fantastic news, really looking forward to seeing V3.

Cheers,

Dave

Please Log in or Create an account to join the conversation.

  • Daniel Alves da Cruz
  • Daniel Alves da Cruz's Avatar
  • Offline
  • New Member
More
5 years 11 months ago #172365 by Daniel Alves da Cruz
Replied by Daniel Alves da Cruz on topic [SOLVED] Seeing unpublished items when logged in front end
In Joomla 3 you usually need to create a Guest user group and Guest access level.

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.

More
5 years 11 months ago #172377 by JoomlaWorks
@Daniel, I don't see how your post replies to the original question...

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum