So, I think the title and summary says it all, but how could I hide part(s) of a page's contents from viewers, but still set it to be visible to certain users?
Yes, there is a very good chance to make differences in the rendered layout, if the hidden content is not visible by source or history ( permisions)
You can use the snippet http://snippets.wikidot.com/system:page-tags/tag/specific_users_only/category/code
or perhaps better http://snippets.wikidot.com/code:specific-users-only ( SUO)
http://snippets.wikidot.com/code:alternative-specific-users-only
typical example is our top-bar menu, where the admins ( I am showing only the nr.1.- 2) have a different column to "normal" users, defined by user-.name ( and the "unique" code ! )
[[include :snippets:suo START unique=first|type=hidefrom
|user1=ed-johnson
|user2=helmut-pdorf]]
* [# Internals]
* [[[system:candidate-for-delete| Candidate for Delete]]]
* [*http://chatroom.wikidot.com/chatroom Chatroom]
* [[[system:list-all-categories | List all Categories]]]
* [[[system:Orphaned-pages |Orphaned Pages ]]]
* [[[system:Page Calendar]]]
* [[[system: Page Tags]]]
* [[[system:page-tags-list|Page Tags List]]]
* [[[system: Recent changes]]]
* [[[system:members | Site members]]]
* [[[user:_activity | User Activities]]]
* [[[system:wanted-pages |Wanted Pages ]]]
[[include :snippets:suo END]]
[[include :snippets:suo START unique=second|type=showto
|user1=ed-johnson
|user2=helmut-pdorf]]
* [# Internals]
* [*http://admindevelopement.wikidot.com/forum:recent-posts Admin Forum]
* [[[admin:_manage|]]]
* [*http://community.wikidot.com/admin-sandbox:_start Admin-Sandbox]
* [*http://backupstorage.wikidot.com/ Backupstorage]
* [[[system:candidate-for-delete| Candidate for Delete]]]
* [*http://chatroom.wikidot.com/chatroom Chatroom]
* [[[Files]]]
* [[[system:list-all-categories | List all Categories]]]
* [[[system: Recent changes]]]
* [[[system:members | Site members]]]
* [[[system:wanted-pages |Wanted Pages ]]]
[[include :snippets:suo END]]
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 ?
Cool, thanks.
Seems clunky a bit (not that I could do better), but works perfectly. :)
There's another alternative that I came up with you may want to consider:
Per-User CSS
If you have several pages where you want to hide/show content, it can be easier to maintain because you just have to keep track of which users have access and won't have to edit the snippet code on each page every time you want to add or remove a user.
It's a different kind of "clunky", but does work very well once the back end framework is set up.
I don't think I'll need this, but I see how it is done.
Basically, I just want to make personal notes on a site, so the user is currently the same: me. And with the basic template, the snippet with my user name is in the text of every new page, so I can just type there my notes and that's all.
One little bug: the text is still in the page source, which means anyone able to Ctrl+U can see it. But, still better than nothing.
If you're talking about Per-User CSS, it's not a bug - it's a limitation that I clearly documented right below the Background section.
A note about security
This technique does not securely hide data from those who know where to look. Anyone viewing the HTML source of your pages will be able to see the content that is hidden using this technique.
If you need truly hidden data, you'll need to use a different platform and use something like PHP that can check who's logged in and dynamically render the content to display before the page loads.
No, I'm talking about the other version (specific_users_only), that's what I use. Though I haven't checked the limitations on that one, I just wanted to warn people that it's not a secure thing.