Specific Users Only
GoVegan 12 Apr 2010 15:30
As announced by myself on my blog, there is now an easy way to show or hide content from specific users.
I've named it the Specific Users Only Include, or SUO for short. It's easy to use, and I encourage you to test it out!
An example of the SUO Include in action is right here:
[[include :snippets:suo BEGIN CODE |unique=first |type=showto |user1=james-kanjo |user2=michal-frackowiak]]
**Hello James Kanjo & Michał Frąckowiak!!!**
[[include :snippets:suo END CODE]]
[[include :snippets:suo BEGIN CODE |unique=second |type=hidefrom |user1=james-kanjo |user2=michal-frackowiak]]
**Hello Everybody Else!!!**
[[include :snippets:suo END CODE]]
Enjoy!
This is awesome :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Hi,
Recently I changed my screen name from "rollinglife" to "Ketan Sevekari". Its good that wikidot accepted it, eventhough I was surprised how it did with a space in between.
However, when I updated my snippet:suo code to update the "user1" value to the new screen name, my page doesn't show the hidden content. Please help me understand the problem. Is its because of the space in between?
Yes, this is definitely the reason.
You schould klick pn your user-name and see thast your wikidot user7screen name is stored eith a hyphen: "ketan-sevekari" ( this is a unix-name)
on http://www.wikidot.com/user:info/ketan-sevekari
there fore you should use ketan-sevekari
( as Michal Frackowiak - the founder of wikidot itself - has to use michal-frackowiak )
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Thanks. It worked.
James,
I haven't tested this yet, but I think it's more than awesome! This, combined with an ifusers module could be very powerful and provide another layer of access for administrative and other content.
Taking a moment to dream out loud, how cool would it be if we could create groups of users and use something like this to selectively display content?! instead of user1, user2 we could use group1, group2.
Nice work, young man!
-Ed
Community Admin
Great advancement, Kanjo! And totally agree with Ed that it would be even greater to use groups in stead of users. While we're at it: Custom groups, that is :D
This is really good. One thing I noticed is that you can't seem to have a blank entry so if there user is an ordinary member of the public and doesn't have a Wikidot account (yes there are such people!) no text gets displayed. Is there a way to target no username?
Good stuff James.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Sorry Rob, it's out of my hands — SUO has been made possible through the ListUsers Module, something of which hides everything from anonymous users. I reckon Wikidot ought to make a new functionality for the ListUsers Module.
Good way to hide NewPage buttons from users. I'll be using this. And, yes please to groups.
*edit* How to (for the "unique=second") hide all other users easily?
You can't use modules inside of this, as it is based on the ListUsers module.
Not sure what you mean. What are you trying to do?
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I think he is asking how to hide content from "everyone else", which is accomplished by simply using the showto type instead of the hidefrom type. Unless or until groups can be used, it's going to be pretty hard to hide content from large numbers of users.
-Ed
Community Admin
Yes Ed, that was what I wast trying to say. Show this content to only me (for example)
Pity about the no modules but now that I have re-read the original post I understand that it is because it's based on ListUsers module.
Thanks to all.
But you can use the Extended NewPage Module in “Manual Mode”… this is basically an improved “NewPage Module”.
I'll have a look and post my results.
*edit* Not quite what I need. I need to be able to specify what the new name will be called. :)
Not sure what you mean Hobstar, that is possible as far as I know.
Can you tell us the use-case, so we understand what you're trying to do? I believe there should be a way to do it, based on what you've told us so far :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
That's the very reason I designed the Extended NewPage Module in the first place… The basic NewPage Module can't do that.
Shall we continue this on the Extended NewPage Module page? :)
I've been trying to work this into my top navigation menu, but the includes create a line break that makes my menu break into two rows. Is there a way to make the content inside the includes display inline? Here's the code I'm using if you want to change the user name and try it on a test nav:top page.
I'm going to play with the css and see if I can work it out, but am hoping there's a simple solution. It's not a huge issue since the menu displays normally to other users.
-Ed
Community Admin
It's working fine for me. Are you sure there is enough space in your theme for an extra item in the menu?
The only thing is that like you have it, the Admin menu appears after the other elements (to the right of) the main menu.
If you switch that around and put the SUO Include at the bottom of the page, the admin menu will appear at the left-most side of the menu instead.
That is because there is a line break in there, and when you add a line break in your nav:top's bullet list it causes the list items to switch places.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I'll double-check the width - I'm pretty sure there's room for it. It could be some other factors in my theme causing this. When I place it on top, the menu item is on top of the rest of my menu. If I move it to the bottom, it's falls on a line below the menu.
Thanks for testing. I'll report back after I dig some more.
-Ed
Community Admin
Just a quick note, the admin menu isn't being detected as a menu option, because it has different styling to usual. (These screenshots are using a slight variation on your code, the include has been moved to the bottom of the page)
Before hovering with mouseAfter hovering with mouse
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I got it sorted out with css. I am using #top-bar ul {display:table;} which makes it easy to center my menu, but was causing the break to 2 lines when I inserted the includes. Changing it to #top-bar ul {display:inline;} moved the admin menu to the left side, but I lose my centering. It still looks OK, so I'll probably keep it in place unless my friend doesn't like the new look.
#top-bar ul {display:table;}
#top-bar ul {display:inline;}
Thanks again for spending some time on this. Seeing your test results made it pretty clear it was something in my css and that made it easier for me to track down. I'll be sure to test this kind of stuff with different themes next time before I go running for help.
-Ed
Community Admin
At time like this, you just need to shout for help… ROB!
Did someone call?
Centering a top menu creates an extra bit of work when you have a liquid design. But one way to do it is to separate the top bar menu items from the background color behind them and, crucially, make the menu items a fixed width but the background color a percentage:
Set your current top bar to be transparent:
#top-bar, #top-bar a, #top-bar ul li { background-color:transparent; }
Set the top bar to be a fixed width, not a percentage, and set the margin to centre the menu:
Using a fixed with of 932px will be fine for monitors at 1024 or above and will include all the current menu items.
#top-bar { margin: 0 auto; width: 932px; }
You should now have a centered menu with a transparent background:
To add the background back in use the #header extra-div-1 rule:
Position the #header-extra-div, add the color and make sure it has a width of 100%:
And the result is shown below:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
He's brilliant, isn't he Ed?
Thanks Rob, you're the best :D
Combined with customizable user groups you could say "Welcome South Australia Salesmen !"
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
nice!
Looks like Custom User groups has been 'rejected' due to (I believe) it would take too long to implement and was too difficult. I'm willing to be corrected here. :)
Perhaps if you could (as a MA) 'tag' each user and then work it that way??? Or is that just the same thing anyway?
Every time you say something on this page, it seems to be said in a completely foreign language…
Sorry, I'll shut up now. :(
Why? I understand HobStar perfectly well…
If slaughterhouses had glass walls, everyone would be vegan. - Paul McCartney
That's exactly the same thing :) , just a slightly different way of going about it, therefore it will take just as long if not longer to implement.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Sorry for rocking the boat, I obviously don't understand what was required to make this happen. :)
Page variables, mixed with includes, mixed with I-don't-know-what-else… I'm thinking this is too much to ask.
But James has shown me otherwise many times over…
I really wish I could!!! But here's the reason that I can't… I hate that bug!!!
I know the dev team is really busy. My personal wishlist puts this parsing order thing at the top. I'm vague about how it all fits together, but it seems to be the critical issue for
You've got these great ideas, and I know there are others out there that we could implement if only this issue were resolved. Should we be compiling a list of projects that depend on this? I wonder if Wikidot's priorities might be affected by a detailed list of the powerful tools that are waiting on this fix.
Keep in mind that Wikidot plans to work on improving the experience for new users next — that is also long overdue.
I'm sure they'll work on things like this for us next, but I think it's reasonable to at least let them work on improving the user interface first :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Maybe I'll understand the value of that when I see it.
To me, we do well when we create these sophisticated tools, share them, and package them for simple reuse on other sites. Sure, there's always tinkering to do, but that's what nurtures the next generation of wiki-gurus.
I agree that the whole point of a wiki is to make it simple for new users. But I don't understand the distinction between sophisticated tools and improved interface for new users. Fully functional integration of data forms, page variables, includes, and ListPages would go a long way toward making things much simpler for our casual users.
I think the point is that people are being stuck before that.
Someone should be able to find wikidot.com, create an account, create a blog, write their first blog post, and share the link with their friends — all in about 10-15 minutes.
At the moment people are registering… and then not sure what to do next (as it illustrated with the occasional "how do I make a wiki" post in the community forums). Or, they are able to create a blank wiki, but have no idea how to edit the main page or turn it into a blog.
Most of what wikidot needs in terms of the user experience is "eye candy" IMO. Most of the functionality is there and there are very powerful tools at the users' disposal - the problem is finding those tools and knowing how to use them. It's not "idiot-proof" enough.
Edit: I'm going off-topic here. What I'm trying to say is, as much as I want these features just like you do, we should be willing to wait a while, as there are other things (UI) that need to be done first. Things that we won't use, but new users will.
I'll shut-up now :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I'll wait, with plenty of good faith, knowing that the team is committed to their user base.
For many of us, there's nothing simpler and more intimidating than a blank page. I wager that's why most users' wikis never get going. I think the technical barriers are very secondary.
And I'm about to do it again =D
Through creating a new “advanced mode”, we are able to achieve this. Just insert the SUO code in your category's live template, with |mode=advanced |unique=live-template as the attributes, and you will be able to perform this:
Keep in mind, as documented here, using the %%title%% variable within the ListUsers Module will display the user's name correctly (with no fancy links).
Hey James, %%name%% does the same thing in the ListPages as %%title%%, and is probably the better variable to use (it's a more natural choice, when what it does is to display the person's username)
I've been trying to teach myself to use %%name%% instead of %%title%%, so that I automatically do the same in my examples to new users.
As for this… un-freaking-believable! YOU ARE A LEGEND!!
Could it… by chance… be used inside the ListPages module? If I remember correctly, the ListUsers module itself does… and your SUO is based on the ListUsers module. Will do some testing.
This is the reason I enjoy being a part of the Wikidot community - there's always awesome new things being created out of the same syntax, because people are thinking outside the boundaries of the documentation and coming up with some awesome stuff!
As I said on my blog on 7th March, Creativeness is the best attribute a community can have.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
The SUO code generates something like this:
So using %%title%% within the ListUsers module will generate “James Kanjo”, as opposed to %%name%% generating “james-kanjo”
Yes… in two ways:
For example: