tags:

views:

310

answers:

2

Hello,

I have several articles on a Joomla (1.5) site. These articles are public -- one does not need to register to see their content.

I would like to add a paragraph (i.e., custom HTML) to some of these articles (the paragraph would be different for each article), and I would like that paragraph to only be visible to registered users. Non-registered users would just see the article without the paragraph (or possibly with a teaser text instead of the paragraph, like "Register to see additional info"). What's the best way to achieve that?

I suppose one way to do this would be to add a custom HTML module that's only visible to registered users. But since I want to display different HTML for each article, I think I would need to create a different module for each article where I want to display the paragraph. Is that unreasonable?

My preferred way, conceptually (I'm making this up just to illustrate what I'm looking for), would be to just write the paragraph in the article editor, highlight it with the mouse, right-click and select "Make highlighted text visible only to registered users". But this doesn't exist (unless someone knows of a plug-in that achieves something similar?).

Is the one-module-per-article approach the closest thing available?

Thanks!

A: 

Pff... I couldn't find an extension to do what I wanted using Google search, but browsing the Joomla extension directory I think I found what I need. I haven't tried it yet, but the description looks promising.

http://extensions.joomla.org/extensions/access-a-security/content-restriction/6004

Jimmy
A: 

I thought this was a very useful plugin so I created one.

http://www.fijiwebdesign.com/products/article-access-plugin.html

Project page: http://code.google.com/p/joomla-article-access/

The plugin allows you to add access control to articles by defining parts of the article which are viewable by certain usergroups.

The different usergroups available are:

  1. guest
  2. registered
  3. author
  4. editor
  5. publisher
  6. manager
  7. administrator
  8. super admininistrator

In order to make a part of the article viewable by a certain group, edit the article as such:

{access view=registered}
Only registered users can view this portion of the article.
{/access}

To exclude a group from viewing an article, use the exclamation mark (!) before the group name.

{access view=!registered}
Any group other then registered can view this portion of the article.
{/access}

To add multiple groups, separate them with a comma (,).

{access view=registered,author,editor}
Only registered,author and editor usertypes can view this portion of the article.
{/access}

To add a any group between two groups (inclusive), use a hyphen (-).

{access view=registered-editor}
Only registered,author and editor usertypes can view this portion of the article.
{/access}

To add any group and above or below a group (inclusive) just leave the group to the right or left blank in order to match to the lowest or highest group.

{access view=-registered}
Only guests and registered users can view this portion of the article.
{/access}
{access view=author-}
Only authors and above can view this portion of the article.
{/access}

You can also mix different group filters/selections together.

bucabay
That seems pretty good, but I can't tell if it does more/less than the plug-in I listed in my answer: http://extensions.joomla.org/extensions/access-a-security/content-restriction/6004 ?
Jimmy
It allows multiple groups and any combination of groups to access to the article.
bucabay