Forum for discussing general topics related to Couch.
13 posts Page 2 of 2
KK wrote: Any problems with the standard approach?

Drafts is good for existing posts to be edited and I can see list of those in admin to push the update to the original.

Unpublished works abut I can only view it in the context of its template. I have several views of the posts in different places and would like to see how they look too. For example, I have a list page that does an excerpt, and if the page has an image come up too soon, it messes with the layout. Probably can be solved with creative CSS work, but I need to see things like this before the public does.

Another case that isn't addressed with these techniques is where I have some posts that are not for public consumption - only registered members. In page view, list view, or whatever. The access level would be a no brainer way of handling this.

KK, I'm aware that Couch is very young (not even to v2 yet) and a great, developing product of which I'm in awe. Please don't take my remarks as criticism, most of them are due to my lack of complete understanding of the system. But if they're not due to my ignorance, I'd like my suggestions to be helping in the development path of the next release and the next one. That's what open source software is all about.
@wysocki, in the last post I could see your real use-case. Thanks for letting us know about multiple listings and requirements. As everything in Couch can be done in various ways (and some things even in a multitude :) ) let me again suggest a working method.

Requirements:
1. Admin-controlled behaviour
2. Easy/reliable settings for non-tech-savvy users
3. Code needs not to be changed for a long time
4. Pages must be seen across all templates
5. Admin must see all pages across all templates regardless of anything.
6. Anything else?


Solution. There is an editable type='password'. It can be used in custom_fields...
Okay, joking :D
The real one is based on this setting: <cms:pages show_unpublished='1'>.

Code: Select all
<cms:pages masterpage=k_user_template show_unpublished="<cms:if k_user_access_level ge '7' >1</cms:if>" id='5153'>
     PAGE: <cms:show k_page_title />
</cms:pages>


Modify it a bit like this in all your listings with cms:pages and you'll get a reliable method where only logged in admin (Greater or Equal 7) can really see any pages in action. I have tested it on my template with an unpublished page with id='5153' and it works perfectly.

So, the setting is enabled only for logged-in admin, no other constant changes in code required, setting is easily controlled in backend - published/unpublished, normal users still can use it and unpublish pages to remove from general listing (therefore feature is not reserved and can function as intended), works across any templates without further tweaking, doesn't require to set up access_level, finally no additional password protections or other hassle :)

If you have cms:pages instances many times on a template, then a new variable can be used multiple times to help like this:
Code: Select all
<cms:set sometimes = "<cms:if k_user_access_level ge '7' >1</cms:if>" scope='global' />

     <cms:pages show_unpublished=sometimes >
            ..
      </cms:pages>



If you'd like to explain your use-case for registered members, which need restricted access to certain pages, I believe I could come up with something too :) I hope you accept my help here :D
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
@wysocki
Please don't take my remarks as criticism...
I'd like my suggestions to be helping in the development path of the next release and the next one. That's what open source software is all about.

No worries :) Your concerns are genuine and the shortcomings you pointed out do need to be rectified. Trust me, your feedback is always welcome and will help shape the future development of Couch.

Coming to the problem at hand, I hope the 'show_unpublished' parameter mentioned by @trendoman helps in covering the use-case you have.
13 posts Page 2 of 2