0
Welcome Guest! Login
0 items Join Now

Article Display based on User?

  • Article Display based on User?

    Posted 15 years 4 months ago
    • Hey everyone,
      I'm working with a business trying to build a product catalog in joomla, that can display different content to different user groups. I'm trying to figure out a way to show different amounts of content based on a users login, and am just trying to figure out if it's possible. Modules aren't an option, simply because with thousands of articles, it's not feasible. What I'm currently trying to figure out is if there is a way to place code around the part of an article I only want a certain user group to see, but not show up when other user groups login to view the page. The end goal is to have the sales group only see information like the product number and styles, and the China office to only see some pricing that they need, and then the corporate office see all the information. I know this is really confusing, and hope I make sense? If anyone has any other option or ideas I'd love to hear them!
      Thanks everybody! :cheesy:
  • Re: Article Display based on User?

    Posted 15 years 4 months ago
    • How about this extension . I never try it, but it seems that extension has the feature you mentioned
  • Re: Article Display based on User?

    Posted 15 years 4 months ago
    • Thanks for your help Arifin, but I was thinking more along the lines of just putting code into the articles, I think that the extension you suggested will help me create user groups though.

      I'm wondering if there is a way to just put an "if" statement that encapsulates the parts of the article I only want some groups to see. I don't know if this works with Joomla? The biggest challenge to this idea is trying to find what to put in the "if" statement, to only show it to specific groups. I know the modules have this capability, but am not sure by what method, or if they even use "if" statements.

      Sorry if this is really confusing, and hope some of this makes sense? Thanks for your help!
  • Re: Article Display based on User?

    Posted 15 years 4 months ago
    • You may try search extensions to put php statement in the article, then you can put something like this:
      <?php 
      $user =& JFactory::getUser();
      if ($user->guest) :
        //do something for guest
      else:
        //do something for logged in users
      endif;
      ?>
  • Re: Article Display based on User?

    Posted 15 years 4 months ago
    • Or maybe this one . Just found it at JED
      How Ninja Access works

      Hide content using this plugin by surrounding the content you want to be seen by certain groups in a tag. Ninja Access uses numbers to specify which group the content includes:

      {njaccess 0} Shows this content only to guests {/njaccess}
      {njaccess 18,19,20,21,23,24,25} Shows this content to all users who are guests {/njaccess}
      {njaccess 24,25,30,31} Shows this content to administrators and 2 custom groups created in JACL {/njaccess}

      When content is not shown to a particular group, the text is simply hidden.

      As you can see from the examples above, you need to know the default Joomla GroupIDs: 0 - Guest, 18 - Registered, 19 - Author, 20 - Editor, 21 - Publisher, 23 - Manager, 24 - Administrator, 25 - Super Administrator.
  • Re: Article Display based on User?

    Posted 15 years 4 months ago
    • Thanks Arifin, this seems to be the perfect solution, it even seems to work with K2! :cheesy:

Time to create page: 0.080 seconds