Using CMSMS 1.9.3, is there a way to preview a News article that has been set to "Draft" status?
I searched the forum and found one of my own posts (http://forum.cmsmadesimple.org/viewtopi ... =2&t=47341) wherein I told someone it could be done, but I think I must have been mistaken. I think I was thinking of viewing expired articles, not drafts.
I know I can use the WYSIWYG News editor, but I want to actually view the article in context on the target page to ensure that it looks correct before setting it live/published. I'm having an issue with tables, where Tiny correctly displays the table border for a couple of seconds when it loads the article, but then the border disappears. I'm not sure if this is just a glitch in the editor pane, or whether it will actually render without the table border when the full page loads on the frontend.
Is there a way to preview "Draft" News articles?
Re: Is there a way to preview "Draft" News articles?
OK.. I have a procedure for you. Ignore the Status ('Published/Draft') and create a Custom Field (checkbox) called 'draft'. When you want it to be hidden, then click on it.
Have your summary template check for $entry->draft.. If it is set, then ignore that entry, unless {$smarty.session.cms_admin_username} is set, indicating that you are logged in
Note that when you log out, {$smarty.session.cms_admin_username} is still set, but if you get a fresh browser, then it won't be set.
If it's a huge security issue, you can do the same with your detail template as well, so that no one can accidently find your detail URL.
One small side effect is that if you are using something like {news number=5} and two of them are 'drafts', you will only get three.
Have your summary template check for $entry->draft.. If it is set, then ignore that entry, unless {$smarty.session.cms_admin_username} is set, indicating that you are logged in
Note that when you log out, {$smarty.session.cms_admin_username} is still set, but if you get a fresh browser, then it won't be set.
If it's a huge security issue, you can do the same with your detail template as well, so that no one can accidently find your detail URL.
One small side effect is that if you are using something like {news number=5} and two of them are 'drafts', you will only get three.
Re: Is there a way to preview "Draft" News articles?
thanks Wishbone - that's a unique idea for a workaround!
I'm going to leave this open for little while longer, to see if anyone else has ideas. If not, I'll likely adopt your suggestion and also file a FR for News in the Forge, so that hopefully the ability to preview Draft articles can be incorporated into the module itself in the future.
I'm going to leave this open for little while longer, to see if anyone else has ideas. If not, I'll likely adopt your suggestion and also file a FR for News in the Forge, so that hopefully the ability to preview Draft articles can be incorporated into the module itself in the future.
Re: Is there a way to preview "Draft" News articles?
Even easier... Create a category called 'Draft'. Put all your drafts in it.
Code: Select all
{if $smarty.session.cms_admin_username}
{news category="General,Draft"}
{else}
{news category="General"}
{/if}
Re: Is there a way to preview "Draft" News articles?
geez, wishbone - you're full of outside-the-box ideas today!! I'd give you karma if I could...
Re: Is there a way to preview "Draft" News articles?
I miss the 'karma' button.. I was starting to rack them up.jmcgin51 wrote:I'd give you karma if I could...
Re: Is there a way to preview "Draft" News articles?
Hi Wishbone,Wishbone wrote: ↑Sat Feb 26, 2011 4:37 pm Even easier... Create a category called 'Draft'. Put all your drafts in it.
Code: Select all
{if $smarty.session.cms_admin_username} {news category="General,Draft"} {else} {news category="General"} {/if}
Can you tell me where to enter this code please?
Regards