Creating links within HTML resources

Creating links within HTML resources

by Ray Lawrence -
Number of replies: 9

In the DCU Using Moodle course some of resources have hyperlink to enable the user to navigate within the text of the resource i.e. like bookmarks in a Word doc.

I can see that there are styles / sections but I can't see how to create them. Can anyone enlighten me?   TIA.

Ray

Average of ratings: -
In reply to Ray Lawrence

Re: Creating links within HTML resources

by Tim Allen -

There is probably a better way, but the way I have achieved this is to use html coding as follows:

<a name="bookmark">Text text text
etc
etc
etc.
<a href=#bookmark>Some text</a>.

Hope this helps,

Tim.

In reply to Tim Allen

Re: Creating links within HTML resources

by Dale Jones -
I'm not in any way a html-confident type, but using anchors as Tim suggests would be the way I'd do it.
In reply to Tim Allen

Re: Creating links within HTML resources

by Ron Banks -

I have tried this but the html editor always comes back writing up a long href name instead.  For example I type in href=#2 and it comes back and fills in the rest of the the link, however it leaves out the id=? (? being whatever the sql id is) and then says that it is missing a parameter and does not render the page.

example (href="http://localhost/moodle/mod/book/#2">) which is not a correct or complete path.

In reply to Ron Banks

Re: Creating links within HTML resources

by Tim Allen -

I know it works in an HTML resource:  this is what my link looks like - http://courses.discoverlanguage.com/mod/resource/view.php?id=821#chorus 

And then I have the anchor tag which looks like this:  <a name="chorus">

In the book module, you have the copy the url from the browser address bar and then paste in the whole link, adding the # part at then end, because if you put just the short link you will get the error you got:

So, (using examples from my site)

paste in http://mooddev.ancoraimparo.info/mod/book/view.php?id=335&chapterid=4/ and add #conn at the end and you will get http://mooddev.ancoraimparo.info/mod/book/edit.php?id=335&chapterid=4/#conn

not http://mooddev.ancoraimparo.info/mod/book/#conn

Hope this helps,

Tim.

In reply to Ron Banks

Re: Creating links within HTML resources

by Gustav W Delius -
This is bug #1550 in the bug tracker. Very annoying.
In reply to Ray Lawrence

Re: Creating links within HTML resources

by Morag Munro -

Hi Ray

Using anchors as Tim suggests is the way that we did this in the DCU course.

Morag