Community Support Forums — WordPress® ( Users Helping Users ) — 2010-11-04T09:36:23-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=1109 2010-11-04T09:36:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1109&p=4497#p4497 <![CDATA[Re: Automating a public excerpt]]>
sugeneris wrote:
Okay, that was the bit I didn't understand. I'd thought the conditionals worked in concert with the various toggles in the general options tab. Instead it seems that what I need to do is turn those basic protections off and just build the protection rules directly into my template files, correct?

(Quick and dirty testing with the example snippet I mentioned above seems to agree, but just confirming.)

Yes, you are correct. Thanks for the reply back.

Statistics: Posted by Jason Caldwell — November 4th, 2010, 9:36 am


]]>
2010-10-30T17:17:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1109&p=4436#p4436 <![CDATA[Re: Automating a public excerpt]]>
(Quick and dirty testing with the example snippet I mentioned above seems to agree, but just confirming.)

Statistics: Posted by sugeneris — October 30th, 2010, 5:17 pm


]]>
2010-10-29T04:00:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1109&p=4389#p4389 <![CDATA[Re: Automating a public excerpt]]> Thanks for the great question.

My client wants to protect entry pages, but for SEO etc. purposes wants to allow the post excerpt to appear publicly on the pages, with a prompt to login/register. So, when an unauthorized visitor tries to view the page ...

Since I posted that, Simple Conditionals were released in recent versions of s2Member, and that's the way you'll probably want to go. The problem I think you're seeing, is caused by the way you want "Excerpts" to work. "Excerpts" are normally displayed in an Archive View of some sort.

Documentation: Protecting individual Posts or Pages, ONLY protects the Permalinks for those Posts. It is still possible for Excerpts of protected content to be seen in search results generated by WordPress®, feeds, and Archive views; such as your Home Page, inside a Category listing, or through other queries formulated by your theme. This is the intended functionality. Excerpts are a great way to "tease" public visitors. In other words, public visitors may have access to excerpts introduced by your theme, but any attempt to view the full Post ( i.e. the Permalink ) will result in an automatic redirect to your Membership Options Page; requiring registration. All of that being said, if you would like to protect many Posts at once ( including Archive views ), you can use Category Level Restrictions, Tag Level Restrictions, or have a look at s2Member's options for "Alternative View Protection", which deals with search results, as well as feeds.

What's important to realize here, is that s2Member will ALWAYS protect the Permalink ( i.e. the full content view ) for the Posts/Pages you protect in the General Options panel, or through the Meta Box on the Post editing form. Because, "Excerpts" should be displayed in an "Archive View" of some kind. If you want to integrate another form of more customized protection, you can use Conditionals.

So here is my recommendation:

Un-protect everything that you've configured in your s2Member General Options Panel, and instead, create your own protections using Simple or Advanced Conditionals, like this:

Code:
Here is the beginning of my Post for everyone to see ...

[s2If current_user_cannot(access_s2member_level1)]
    To see the rest of this post, please register or login.
[/s2If]


[s2If current_user_can(access_s2member_level1)]
    ... here is the rest of my content.
[/s2If]
So here you are handling things in a much more advanced (custom) way. You can just forget about s2Member's protections in the General Options panel in this case.

Statistics: Posted by Jason Caldwell — October 29th, 2010, 4:00 am


]]>
2010-10-27T14:28:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1109&p=4317#p4317 <![CDATA[Automating a public excerpt]]>

Introductory paragraph or whatever.
To see the rest of this post, please register or login.


We've found this prior forum post, but it's regarding specifying an excerpt manually every time, which I'd like to avoid.

Now, as far as I can tell, what I need is the Advanced Query Conditionals functions, and the examples in there seem obvious enough. I was thinking example #2, except instead of the continue statement, I'd actually echo out some content. But I've experimented a little, and no matter what I do, the page simply kicks me to the subscription options page rather than showing the sample content. Is there something I need to additionally disable, or am I going about this the entirely wrong way?

Statistics: Posted by sugeneris — October 27th, 2010, 2:28 pm


]]>