Displaying the factbox depending on user group

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Displaying the factbox depending on user group

Schneider, Martin
Hi all,

we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.

Now, we want to display information according to mediawiki user groups.
This concerns the content, the skin and the factbox.

We want knowledge modellers to see the factbox and readers to not see the factbox.

I have tried to solve this using the ConditionalShowSection extension of MediaWiki.
(http://www.mediawiki.org/wiki/Extension:ConditionalShow)

Our default is to show the factbox. So I inserted the magic word __NOFACTBOX__
into a conditional section like this:
<cshow logged=1 ingroup=reader> this text is only for readers
__NOFACTBOX__
  This is more text.  </cshow>

When logged in as a member of the user group "reader" I see both texts.
The magic word __NOFACTBOX__ is not to be seen but the factbox is still displayed.

Has someone tried something like this before? Where should I look to solve this?
Is there another way/extension/whatever to handle such situations?

Thanks for your effort!
Martin


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Displaying the factbox depending on user group

Yaron Koren-2
Hi Martin,

I'm not surprised that that doesn't work - __NOFACTBOX__ doesn't directly
turn off the display; rather, it sets a flag in the database, that the code
then checks every time to see whether the factbox should be displayed.

Personally I view the SMW factbox (which is distinct from the template
infobox) as useful for debugging purposes only, and not something that
anyone should really see on a regular basis. So if it were me, I would just
turn it off, and tell people who want to look at the set of properties for
a page to click on the "Browse properties" link at the bottom of the
sidebar. I don't know if that counts as an acceptable answer.

-Yaron


On Tue, Feb 4, 2014 at 11:54 AM, Schneider, Martin <
[hidden email]> wrote:

> Hi all,
>
> we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.
>
> Now, we want to display information according to mediawiki user groups.
> This concerns the content, the skin and the factbox.
>
> We want knowledge modellers to see the factbox and readers to not see the
> factbox.
>
> I have tried to solve this using the ConditionalShowSection extension of
> MediaWiki.
> (http://www.mediawiki.org/wiki/Extension:ConditionalShow)
>
> Our default is to show the factbox. So I inserted the magic word
> __NOFACTBOX__
> into a conditional section like this:
> <cshow logged=1 ingroup=reader> this text is only for readers
> __NOFACTBOX__
>   This is more text.  </cshow>
>
> When logged in as a member of the user group "reader" I see both texts.
> The magic word __NOFACTBOX__ is not to be seen but the factbox is still
> displayed.
>
> Has someone tried something like this before? Where should I look to solve
> this?
> Is there another way/extension/whatever to handle such situations?
>
> Thanks for your effort!
> Martin
>
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Displaying the factbox depending on user group

Cavila Contrafibularity
In reply to this post by Schneider, Martin
Hi Martin,

I don't know about Extension:ConditionalShow, but what about https://www.mediawiki.org/wiki/Extension:SimpleSecurity ? It comes with a parser function that can be used to hive off a portion of text and then to specify which group is allowed to view this. So if it suits your situation (?), you could switch off the factbox for general readers, but enable it inline for your modellers, e.g.

{{#ifgroup:<nameofgroup>|__FACTBOX__}}

Regards,
Cav

> From: [hidden email]
> To: [hidden email]
> Date: Tue, 4 Feb 2014 16:54:50 +0000
> Subject: [Semediawiki-user] Displaying the factbox depending on user group
>
> Hi all,
>
> we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.
>
> Now, we want to display information according to mediawiki user groups.
> This concerns the content, the skin and the factbox.
>
> We want knowledge modellers to see the factbox and readers to not see the factbox.
>
> I have tried to solve this using the ConditionalShowSection extension of MediaWiki.
> (http://www.mediawiki.org/wiki/Extension:ConditionalShow)
>
> Our default is to show the factbox. So I inserted the magic word __NOFACTBOX__
> into a conditional section like this:
> <cshow logged=1 ingroup=reader> this text is only for readers
> __NOFACTBOX__
>   This is more text.  </cshow>
>
> When logged in as a member of the user group "reader" I see both texts.
> The magic word __NOFACTBOX__ is not to be seen but the factbox is still displayed.
>
> Has someone tried something like this before? Where should I look to solve this?
> Is there another way/extension/whatever to handle such situations?
>
> Thanks for your effort!
> Martin
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
     
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Displaying the factbox depending on user group

Cavila Contrafibularity
Oh, and make that __SHOWFACTBOX__ (not __FACTBOX__)

By the way, "facts" can be a grave misnomer depending on what sort of wiki you're working on. Something like "statements" or "factoids" would be nearer the mark, but that's for another discussion.

Cav

> From: [hidden email]
> To: [hidden email]; [hidden email]
> Date: Tue, 4 Feb 2014 22:40:48 +0000
> Subject: Re: [Semediawiki-user] Displaying the factbox depending on user group
>
> Hi Martin,
>
> I don't know about Extension:ConditionalShow, but what about https://www.mediawiki.org/wiki/Extension:SimpleSecurity ? It comes with a parser function that can be used to hive off a portion of text and then to specify which group is allowed to view this. So if it suits your situation (?), you could switch off the factbox for general readers, but enable it inline for your modellers, e.g.
>
> {{#ifgroup:<nameofgroup>|__FACTBOX__}}
>
> Regards,
> Cav
>
> > From: [hidden email]
> > To: [hidden email]
> > Date: Tue, 4 Feb 2014 16:54:50 +0000
> > Subject: [Semediawiki-user] Displaying the factbox depending on user group
> >
> > Hi all,
> >
> > we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.
> >
> > Now, we want to display information according to mediawiki user groups.
> > This concerns the content, the skin and the factbox.
> >
> > We want knowledge modellers to see the factbox and readers to not see the factbox.
> >
> > I have tried to solve this using the ConditionalShowSection extension of MediaWiki.
> > (http://www.mediawiki.org/wiki/Extension:ConditionalShow)
> >
> > Our default is to show the factbox. So I inserted the magic word __NOFACTBOX__
> > into a conditional section like this:
> > <cshow logged=1 ingroup=reader> this text is only for readers
> > __NOFACTBOX__
> >   This is more text.  </cshow>
> >
> > When logged in as a member of the user group "reader" I see both texts.
> > The magic word __NOFACTBOX__ is not to be seen but the factbox is still displayed.
> >
> > Has someone tried something like this before? Where should I look to solve this?
> > Is there another way/extension/whatever to handle such situations?
> >
> > Thanks for your effort!
> > Martin
> >
> >
> > ------------------------------------------------------------------------------
> > Managing the Performance of Cloud-Based Applications
> > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>      
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
     
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Displaying the factbox depending on user group

James HK
In reply to this post by Schneider, Martin
Hi,

You could use [1] to manipulate the Factbox data or behaviour
dynamically based on your specific requirements.

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/technical/hooks.md#smwfactboxshowcontent

Cheers

On 2/5/14, Schneider, Martin <[hidden email]> wrote:

> Hi all,
>
> we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.
>
> Now, we want to display information according to mediawiki user groups.
> This concerns the content, the skin and the factbox.
>
> We want knowledge modellers to see the factbox and readers to not see the
> factbox.
>
> I have tried to solve this using the ConditionalShowSection extension of
> MediaWiki.
> (http://www.mediawiki.org/wiki/Extension:ConditionalShow)
>
> Our default is to show the factbox. So I inserted the magic word
> __NOFACTBOX__
> into a conditional section like this:
> <cshow logged=1 ingroup=reader> this text is only for readers
> __NOFACTBOX__
>   This is more text.  </cshow>
>
> When logged in as a member of the user group "reader" I see both texts.
> The magic word __NOFACTBOX__ is not to be seen but the factbox is still
> displayed.
>
> Has someone tried something like this before? Where should I look to solve
> this?
> Is there another way/extension/whatever to handle such situations?
>
> Thanks for your effort!
> Martin
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Displaying the factbox depending on user group

Olaf Lenz-2
We use the following solution (e.g. in LocalSettings.php) to turn the
factbox on only when a user is logged in. It is a bit of a hack, but it
works fine.

# Turn the SMW factboxes only on when user is logged in
$smwgShowFactbox = SMW_FACTBOX_HIDDEN;
function icpwiki_factbox() {
  global $wgUser, $smwgShowFactbox;
  require_once("includes/StubObject.php");
  if(  StubObject::isRealObject( $wgUser )
       && $wgUser->isLoggedIn())
    {
      $smwgShowFactbox = SMW_FACTBOX_NONEMPTY;
    }
  return true;
}
$wgHooks['ArticlePageDataBefore'][] = 'icpwiki_factbox';

Best regards
  Olaf


2014-02-05 0:25 GMT+01:00 James HK <[hidden email]>:

> Hi,
>
> You could use [1] to manipulate the Factbox data or behaviour
> dynamically based on your specific requirements.
>
> [1]
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/technical/hooks.md#smwfactboxshowcontent
>
> Cheers
>
> On 2/5/14, Schneider, Martin <[hidden email]> wrote:
> > Hi all,
> >
> > we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.
> >
> > Now, we want to display information according to mediawiki user groups.
> > This concerns the content, the skin and the factbox.
> >
> > We want knowledge modellers to see the factbox and readers to not see the
> > factbox.
> >
> > I have tried to solve this using the ConditionalShowSection extension of
> > MediaWiki.
> > (http://www.mediawiki.org/wiki/Extension:ConditionalShow)
> >
> > Our default is to show the factbox. So I inserted the magic word
> > __NOFACTBOX__
> > into a conditional section like this:
> > <cshow logged=1 ingroup=reader> this text is only for readers
> > __NOFACTBOX__
> >   This is more text.  </cshow>
> >
> > When logged in as a member of the user group "reader" I see both texts.
> > The magic word __NOFACTBOX__ is not to be seen but the factbox is still
> > displayed.
> >
> > Has someone tried something like this before? Where should I look to
> solve
> > this?
> > Is there another way/extension/whatever to handle such situations?
> >
> > Thanks for your effort!
> > Martin
> >
> >
> >
> ------------------------------------------------------------------------------
> > Managing the Performance of Cloud-Based Applications
> > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>


--
Dr. rer. nat. Olaf Lenz
Institut für Computerphysik, Allmandring 3, D-70569 Stuttgart
Phone: +49-711-685-63607
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Displaying the factbox depending on user group

Schneider, Martin
Hi Yaron, James, Olaf and Cav,
Thanks for your replies!
As so often I have now more urgent things to do and have to look at this later.
For now, we will use simply two pages which differ in layout and the one has the __NOFACTBOX__ without any conditions. This is a workaround just for showing the different layouts and will only be used for two or three different topics. Later on, we will have the different layouts for all pages in the wiki, so an automatic approach is needed and then I will come back to your answers.
Being rather a newbie to MediaWiki and SMW I have subscribed to this mailing list only a few weeks ago and I really like reading it, getting inspirations and information about issues which I haven’t encountered yet but surely will sometime in the future.
Thanks again,
Martin

On 2/5/14, Schneider, Martin <[hidden email]<mailto:[hidden email]>> wrote:

> Hi all,
>
> we have set up a SMW using Mediawiki 1.17.5 and SMW 1.7.1.
>
> Now, we want to display information according to mediawiki user groups.
> This concerns the content, the skin and the factbox.
>
> We want knowledge modellers to see the factbox and readers to not see the
> factbox.
>
> I have tried to solve this using the ConditionalShowSection extension of
> MediaWiki.
> (http://www.mediawiki.org/wiki/Extension:ConditionalShow)
>
> Our default is to show the factbox. So I inserted the magic word
> __NOFACTBOX__
> into a conditional section like this:
> <cshow logged=1 ingroup=reader> this text is only for readers
> __NOFACTBOX__
>   This is more text.  </cshow>
>
> When logged in as a member of the user group "reader" I see both texts.
> The magic word __NOFACTBOX__ is not to be seen but the factbox is still
> displayed.
>
> Has someone tried something like this before? Where should I look to solve
> this?
> Is there another way/extension/whatever to handle such situations?
>
> Thanks for your effort!
> Martin
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]<mailto:[hidden email]>
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]<mailto:[hidden email]>
https://lists.sourceforge.net/lists/listinfo/semediawiki-user



--
Dr. rer. nat. Olaf Lenz
Institut für Computerphysik, Allmandring 3, D-70569 Stuttgart
Phone: +49-711-685-63607
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user