By wOOge on
Hey all,
I was wondering if anyone knows of a way I can setup my Drupal site so that anonymous visitors can view teasers on the site, but have to click a "Login to read the rest of this article" link to view the whole article? - or when they click on the article itself, it asks them to log in, then sends them to the article after they're in.
Right now I post teasers in a separate category that has permissions allowing all to view it - then I post a copy of the full story in another category for logged in users to view. I'm looking for a way to get around having to post these (sorta) duplicate pages :(
Comments
me too
.
I don't know if it's the
I don't know if it's the best way, but you can use Contemplate to return a different body text for anonymous users. It wasn't designed for this use, but it works well.
All that you do is, for the body area, use this code:
You'll have to fill in the missing pieces, of course. I don't remember how the variables are accessed in Contemplate (it's been a while since I used it), but I know it can be done. In fact, I believe that the available variables are shown in a block just to the right of the code input area.
Hope that helps.
- Corey
I'll try that out..
Hmm, this looks promising - I'll def. give it a shot - thanks Corey.
--
wOOge | axonz.com
--
wOOge | adrianjean.ca
Did you manage to find a solution?
I am interested in this as well. Did you manage to find the solution?
Solution coming...
I came up with a working solution to this - I'll try to post the code today.
--
wOOge | axonz.com
--
wOOge | adrianjean.ca
Premium Module
I found that Premium Modules (http://drupal.org/project/premium) will probably do the task but there is no version for Drupal 5.1 and there does not seem to be active development on this.
thanks for the find, we are
thanks for the find, we are using 4.7 and this works for us :D
I'm looking for something
I'm looking for something similar as well, and while the contemplate solution brings it a step closer its not quite what I'm looking for..
I'd like everyone to be able to view the teasers of a custom node type I created called Lesson, and when they click on it they will see the teaser and a brief passage promoting membership along with a link to sign up. The 'Lesson' type is part of a private organic group (that I use for courses we run) that paid members have access to.
So if you find a similar solution please post it, Cheers :)
---
http://www.irrow.com/
Here it is...
Ok, it's a little late, but here it is.
This isn't a tutorial, its an example of what I've done - you'll have to create your own categories, and roles to make this your own - but the code all works.
I'm running 4.7.
I have roles setup for Authors, and for subscribers. I also have different categories assigned as feeds that users can "subscribe" to. This script shows the page while in "preview" mode, like on lists and the home page, then when displaying the full page, it checks that you're a subscriber and acts accordingly.
This also requires that you use the -- drupal break -- feature to break the story. I'm not sure if it works if you use the automatic teaser feature.
The following code goes into your node.tpl.php and replaces the code that shows the page's content.
Hope this helps others out there!
--
wOOge | axonz.com
--
wOOge | adrianjean.ca
will this work for version 5?
Good Day,
I was wondering if this will work for version 5?
Thank you,
Mark
Will this or a similar solution work for version 5
The original problem must have been addressed already. Can anyone recommend the best solution? I'm also running Drupal 5.
Thanks in advance.
_
5 comments up: http://drupal.org/project/premium
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz