- Posts: 38
COMMUNITY FORUM
Login to Read More
- jo
-
Topic Author
- Offline
- Junior Member
Can someone help. I have searched online high and low but can not find a solution to something that seems it should be an obvious thing to want!
I just want to have the intro of an article available to everyone, and the full article available to members only. Just a simple: login to read more...... action.
I am using Joomla 2.5.8 and K2 2.6.1
Perhaps I'm asking the wrong question when I search. Am I missing something?
Many thanks
Jo
Please Log in or Create an account to join the conversation.
- Gregwh
-
- Offline
- Senior Member
- Posts: 57
jo wrote: Hello
Can someone help. I have searched online high and low but can not find a solution to something that seems it should be an obvious thing to want!
I just want to have the intro of an article available to everyone, and the full article available to members only. Just a simple: login to read more...... action.
I am using Joomla 2.5.8 and K2 2.6.1
Perhaps I'm asking the wrong question when I search. Am I missing something?
Many thanks
Jo
Interesting. Never thought of it quite like that. I run a site www.sell-my-books.com and of course I want people to read some of the book and pay for the rest, for the authors who come to the site. In order to achieve that I had to get PayPerDownload Plus which also works with Joomla Articles and K2 Items to be read. However, it does that in 2 ways:
1) Completely denying access to the item until you logon and when you logon, then pay for the one to be pay to be read.
or
2) Allows you to put, through it and not through the normal READ MORE, the ability to read whatever portion you think is right. Within the K2 item or Joomla Article, you place a "pay to read more" internal link that stops the item from displaying anything more than you have allowed and then asking you to logon and then after that, to pay for reading it, which is the whole idea of my site.
So, when I first thought the idea up, I went down that path and after much research, it appeared to me that to do what you want to do or I want to do, you need to go to the Joomla Extensions area and search for a pay to read more link that works with K2, stops the person reading more and demands they logon, as it does for me.
Your only other alternative would be to have the part OK for anyone to read with a PUBLIC access level and the rest with REGISTERED in 2 separate K2 items and tell people they can see the rest if they logon. One thing wrong with doing it this way is that it deters people from coming to your site. So a Joomla extension is the only thing I can see, personally, that will work for you short of being able to code for yourself (which I cant).
Greg.
Please Log in or Create an account to join the conversation.
- jo
-
Topic Author
- Offline
- Junior Member
- Posts: 38
Hum, i;llcheck out the extension you used. However, couple of things;
1. I understand that this function is available when using Joomla as the core content management by selecting the "show unauthorised link" option. However, I like K2! I find it much more flexible for displaying and organising content.
2. I thought about the idea of having 2 items: 1 intro - opento all and 2. the full article with permissions set to "Registered". The probelm with this is that I am building a community site that allows members to submit articles and I don't want to confuse the issue for them by asking them to take the 2 steps, rather than just the one.
3. I came across another extension, but it required putting different tags around the open part and the registered part - again, I didn't want to confuse thecontributors by requiring additional steps.
4. I also came across a hack for changing some code in k2, but it was for an earlier version and the directories were labeled differently and i'm just not experienced enough to risk it! Having said that of course, I'll never get expereinced until I risk it!
I just thought this would be a basic feature for K2, haven't needed it on previous sites and didn't expect it to be a problem now that I do.
Looks like I may have to just roll my sleaves up and dive in with the hack.
Will check out the extension you mentioned, and post anything else I find. I am sure there must be plenty of other folk looking for the same functionality.
Thanks again
Jo
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
use something like this to wrap around the parts you wan to hide in an override
$user =& JFactory::getUser();
if (!$user->guest) {
display fulltext
} else {
display message to registar to readmore
}
docs.joomla.org/JFactory/getUser
Please Log in or Create an account to join the conversation.
- jo
-
Topic Author
- Offline
- Junior Member
- Posts: 38
No i'm afraid that isn't going to work for what I need. Think I'm going to have to drop K2 for this particular site. Will have to work with the standard Joomla content management feature.
thanks anyway
Please Log in or Create an account to join the conversation.
- Alex B.
-
- Offline
- New Member
- Posts: 8
jo wrote: Can someone help....
I just want to have the intro of an article available to everyone, and the full article available to members only. Just a simple: login to read more...... action.
If you consider commercial extensions as well, then may find our module helpful.
Our RAXO All-mode K2 module works with K2 content and has the functionality you request.
Show Non-public Content Option
In module blocks you can show part of K2 access restricted items publicly (for all visitors). When an anonymous user clicks title/read more link, he doesn’t see hidden information but is redirected to registration/login form.
This option can be quickly enabled/disabled in module administration panel.
This new feature will be extremely useful for sites that have a content restricted area, which usually require registration/sign up/membership/etc. to get access to this non-public content. The best way to encourage site visitors to register and join site community is to show short teasers of the hidden content. When a user sees a part of access restricted information he becomes really motivated to start registration immediately and get access to the full information.
You can read more about this module in blog announcement post:
raxo.org/blog/news/76-raxo-all-mode-k2-j25-announcement.html
Please Log in or Create an account to join the conversation.
- Tomasz Bieliński
-
- Offline
- Senior Member
- Posts: 42
Thanks for your tip. Unfortunately I am not clever enough to manage myself ;-(
Below is a part of item.php file which should be (I presume) overrided. Could you edit it, please according to your tip?
<?php if(!empty($this->item->fulltext)): ?>
<?php if($this->item->params->get('itemIntroText')): ?>
<!-- Item introtext -->
<div class="itemFullText jbintrotext">
<?php echo $this->item->introtext; ?>
</div>
<?php endif; ?>
<?php if($this->item->params->get('itemFullText')): ?>
<!-- Item fulltext -->
<div class="itemFullText">
<?php echo $this->item->fulltext; ?>
</div>
<?php endif; ?>
<?php else: ?>
<!-- Item text -->
<div class="itemFullText">
<?php echo $this->item->introtext; ?>
</div>
<?php endif; ?>
Please Log in or Create an account to join the conversation.