- Posts: 19
COMMUNITY FORUM
Show registered item summary to public
- Prashanth
-
Topic Author
- Offline
- New Member
I would like to be able to show items marked for registered users only in the category listing even for public users. That was the public users get to see a summary of the article and on clicking read more they are asked to register. Kindly let me know which file i need to edit to be able to do this.
Thanks
Prashanth
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
You can do that :
- Override K2 template to avoid k2 core files modification and K2 update problem : doc here
- Modify item.php and category.php of your K2 template to test if a registered user is connected and display what you want (full text or summary+registration link).
Olivier
Please Log in or Create an account to join the conversation.
- Prashanth
-
Topic Author
- Offline
- New Member
- Posts: 19
What i wanna do is display items marked for registered users only in the category listing. In category.php, i donot see any code where there is a check for the access right of the item. No matter what the access rights of the item be, i wanna show it in the category listing. Can you tell me as to where are the access rights for a particular item checked?
Thanks
Prashanth
Olivier Nolbert said:Hi Prashanth,
You can do that :
- Override K2 template to avoid k2 core files modification and K2 update problem : doc here
- Modify item.php and category.php of your K2 template to test if a registered user is connected and display what you want (full text or summary+registration link).
Olivier
Please Log in or Create an account to join the conversation.
- Prashanth
-
Topic Author
- Offline
- New Member
- Posts: 19
Prashanth said:Hi Olivier,
What i wanna do is display items marked for registered users only in the category listing. In category.php, i donot see any code where there is a check for the access right of the item. No matter what the access rights of the item be, i wanna show it in the category listing. Can you tell me as to where are the access rights for a particular item checked?
Thanks
Prashanth
Olivier Nolbert said:Hi Prashanth, You can do that :
- Override K2 template to avoid k2 core files modification and K2 update problem : doc here
- Modify item.php and category.php of your K2 template to test if a registered user is connected and display what you want (full text or summary+registration link).
Olivier
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Sure, your solution works but now, you have to care about K2 updates which could/will override your modifications.
In category.php, which processes display of the category listing, you have to add the access right code. By doing this in your own K2 template, you don't have to care about future K2 updates.
Olivier
Please Log in or Create an account to join the conversation.
- Prashanth
-
Topic Author
- Offline
- New Member
- Posts: 19
I dont understand how i can modify category.php.
The list of items category.php would receive will not have the items marked for registered users and the getData function would perform an SQL query for only items marked for public users. So in category.php, i will not be able to do anything as i donot have the items in the first place.
Am i missing something here.
Thanks
Prashanth
Olivier Nolbert said:Prashanth,
Sure, your solution works but now, you have to care about K2 updates which could/will override your modifications.
In category.php, which processes display of the category listing, you have to add the access right code. By doing this in your own K2 template, you don't have to care about future K2 updates.
Olivier
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
What do you mean by 'marked item', how do you do that ?
In the category.php, you can add code to test if a user is connected, and if so, displaying the item full text.
Maybe i am missing something too.
Olivier
Please Log in or Create an account to join the conversation.
- Prashanth
-
Topic Author
- Offline
- New Member
- Posts: 19
In K2 if an item has access rights of registered, the category listing would not show the item to guest users. This is because under model/itemlist.php the SQL query gets only the items whose access id is <= the users access id.
This is why i had to modify the SQL query itself as I would be unable to do anything in category.php.
Can you think of any other way that i could have done this?
Olivier Nolbert said:Hi Prashanth,
What do you mean by 'marked item', how do you do that ?
In the category.php, you can add code to test if a user is connected, and if so, displaying the item full text.
Maybe i am missing something too.
Olivier
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Sure, i've missed a thing, a BIG thing :-)
Your solution is the only one, unfortunately...
Olivier
Please Log in or Create an account to join the conversation.
- ehsan rezazadeh
-
- Offline
- New Member
- Posts: 2
im not very professional in programming .i have the same problem too.
can u help me to solve it step by step?
how can i show the registered item title to global users?
Please Log in or Create an account to join the conversation.
- Olivier Karfis
-
- Offline
- Elite Member
Without having to modify any code, I found that Dioscouri's "Hider" plugin works pretty well do this kind of thing (and actually allows more flexibility like allowing you to display customized "call-to-action" to guest users accessing a registered only item.
NOTE: this does not work if you enable full content in the RSS feed so be careful (but if you only display your intro in the RSS feed you should be OK).
extensions.joomla.org/extensions/access-a-security/content-restriction/6004
--Olivier ehsan rezazadeh said:
hi
im not very professional in programming .i have the same problem too.
can u help me to solve it step by step?
how can i show the registered item title to global users?
Owner of www.FrenchToday.com - K2 fan and freelancer, runs the Joomla/K2 tip site: www.yanaku.com
Please Log in or Create an account to join the conversation.
- ehsan rezazadeh
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Mantas Phunk
-
- Offline
- New Member
- Posts: 3
Maybe You can share your modifications? It's very urgent
Thank You in Advice.
Please Log in or Create an account to join the conversation.
- Mantas Phunk
-
- Offline
- New Member
- Posts: 3
K2 is great!
Please Log in or Create an account to join the conversation.
- Gerald Moore
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- Mars Cureg
-
- Offline
- New Member
- Posts: 11
I need this to be fix on our website
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.