Hide Front Page Topic Activities

Hide Front Page Topic Activities

Jason De Donno -
回帖数:4

Hi

I have a Front Page which has some has limited guest access. It's basically just a picture and some intorductory text. However, when a user logs in, the news also appears on the front page, as well as a number of blocks.

What I would like is to have  resources and activities that are part of the front page topic to also be hidden to guests but available to authenticated users.

These resources and activities include a general forum for students from all courses.

Is this possible?

回复Jason De Donno

Re: Hide Front Page Topic Activities

Jason De Donno -

The best work around so far is to hide these resouces, then use Front Page overide permissions to make them viewable for students.

It works, but they are grayed out, as they would be if an administrator were viewing hidden resources - no user friendly.

回复Jason De Donno

Re: Hide Front Page Topic Activities

Mary Cooch -
Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Testers的头像 Translators的头像

I haven't tested this so I don't know if it will work but how about putting them in the main menu block and then preventing guests from seeing the block - how you do it depends if you are 1.9 or 2 and  I can't remember. But if being prevented from seeing the main menu block also prevents them from seeing the links then that would be useful - though as I say, I haven't tested it.

回复Mary Cooch

Re: Hide Front Page Topic Activities

Jason De Donno -

Hi

Oops - I had I just edited my previous post!

Your suggestion sounds feasible, but I have already hidden the main menu block from everyone because there are other hidden items in there (feedback).

Using overide roles has given me a solution but its not really satisfactory because they are grayed out, although functional.

http://docs.moodle.org/20/en/Resource_permissions

[Using Moodle 2.2.2]

回复Jason De Donno

Re: Hide Front Page Topic Activities

Itamar Tzadok -

No, it doesn't hide the links and this has been discussed recently in another forum.

I've made a designated hack that extends the show_description feature and allows me to set the activity to display the link (and icon) only in editing mode.

It should be possible to achieve the effect by css. The technique is to hide by default the activity links and then reveal them by means of a block that is set by permissions to be available only to authenticated users.

The quickest way to see how this works is the following.

In the summary of the frontpage topic add the following css in html mode (you may need to turn the editor off in your user profile):

<style type="text/css">
.pagelayout-frontpage  li.activity{display:none;}
</style>

(You can also add this css definition in your theme)

Then add an html block (if the above css is in the summary the block must be in the right column) and in its backend html (editor off) enter

<style type="text/css">
.pagelayout-frontpage  li.activity{display:block;}
</style>

Go to the block permissions and remove Guest from the view permission.

The block won't be visible to anyone and the activities visible only to authenticated users.

微笑