Simple hack to simulate navigation bar to show only one section

Simple hack to simulate navigation bar to show only one section

Peter Evans -
回帖数:5
The following course shows a simple hack (screen image below) to show only one section or week or topic of a course.

http://www.baker-evans.com/community/course/view.php?id=20 (opens in a new window)

It uses the existing "show only topic ?" blue boxes (which new users get confused with) and thus remembers the state you left it in. It ain't a perfect solution but it is a workable one and does not require you to to have admin access or install any new themes or blocks.

Any feedback gratefully received.

PeterEvans
附件 nav_bar_showing_a_single_section.gif
回复Peter Evans

Re: Simple hack to simulate navigation bar to show only one section

Itamar Tzadok -
A possible limitation of the horizontal approach is that it may not work as nicely with 16 or 20 topics or even with less topics but longer titles. An alternative approach would be to outline these links vertically in an html block (see image below) or side-bar block. The side-bar is actually much easier to construct and requires no knowledge of HTML and CSS, but may be less attractive because the links come with the web icon and the appearance is determined by the theme. 微笑


附件 course-menu-htmlblock.png
回复Itamar Tzadok

Re: Simple hack to simulate navigation bar to show only one section

Peter Evans -

Excellent suggestion, Itamar.

Blow is a screen image of the block showing only the topics. The advantage of using Moodle to show the items in each topic is that Moodle will display if there are unread messages in the forums.

A demonstration and the instructions (very easy) are given at http://www.baker-evans.com/community/course/view.php?id=20

Peter Evans

附件 moodle_-_navigatin_block.gif
回复Peter Evans

Re: Simple hack to simulate navigation bar to show only one section

Faren Heit -
Hi Peter,

I quite like it as my users wanted a some sort of contents list and preferred to go straight to each section etc, so this is ideal.

I have tried this in a demo course and got it to work prob around 50%, the issue i have is that when i click on a topic the Nav Bar dissapears and shows the appropriate topic.

I just need to fix this minor issue and it'd be perfect. 微笑

thanx
回复Faren Heit

Re: Simple hack to simulate navigation bar to show only one section

Peter Evans -
The demonstration of this is at http://www.baker-evans.com/community/course/view.php?id=20

If the Cascading style sheet and the HTML are entered it should work on all browsers. It is not a perfect solution but is workable.

Itamar suggests the use of the HTML block and that is even easier.
  • Create a HTML block
  • add the text of the different topics into it
  • create a link for each of the topics by copying the link destination for the little blue box that shows only one topic e.g. http://www.baker-evans.com/community/course/view.php?id=20&topic=3
  • you will need to change the topic number for each of the links and topic 0 will display all the topics
Peter Evans