Posts made by Itamar Tzadok

Hi Brad,

Just in case you don't find how to make a new resource type (sorry I can't help in that yet) an alternative way may be to store the pre-canned blocks of HTML in a database activity (which can reside in a meta-course so every course that needs access to these blocks can be a child course of that meta) and to turn on the RSS of that database. In the main page of a course you add some javascript that summons this RSS, loads its XML and places a certain item in a certain div tag on the page. So the loop can check for the existence of an identified div and send the content of item N to div id=descN. A teacher then looks up a desired item in the database, say item 23, and in the course page adds a label and in the label's html enters <div id="desc23"></div>. In this solution teachers may be allowed to add blocks or modify blocks if required. This is a local solution and a new resource type will be much more efficient and elegant so again this is 'just in case'. smile

Itamar
Hey Peter,

The code you added should probably be in one of the database tables. I remember a discussion in one of the forums on a similar problem so you can try to search for it. But I don't know enough about it because I'm just a lowly user (blush) so my improvisations are always from a user perspective on the front end. Here is what you can do:

  • Open the page html source and look up that html code you added to the page.
  • Copy that code to notepad or something of the like.
  • Now you need to look for the closest identified parent td or div tag, namely, a td or div tag in which your added html resides.
  • If the identified enclosing tag is an immediate parent then in the html block you add something like (remove stars):
<**script**>
<!--
document.getElementById("id of enclosing tag").innerHTML="";
//-->
<*/*script**>

  • If the identified enclosing tag is not an immediate parent then you either get to the immediate parent by navigating the DOM or you search and replace your added html code like that (remove stars):

<**script**>
<!--
reBadCode = /string of added html/;
document.getElementById("id of enclosing tag").innerHTML.replace(reBadCode,"");
//-->
<*/*script**>

  • Keep some extra windows or tabs open in edit mode of the html block where you add the javascript so that you can access that javascript and change it in case something goes wrong.
  • If you attach the html source of your front page I can probably offer more specific instructions.
Itamar smile

Good news smile It was just a bad dream after all. approve

I actually use spans but with class names rather than particular style definitions. I put some css definitions such as .highlight1 {font-weight:bold;} .highlight2 {font-weight:bold;font-size:12pt} etc. in a designated html block. Then instead of specifying the particular styles for each resource label I simply state the desired class name as in <span class="highlight1">. And then if I decide that highlight1 should also be size 6, I go to the definition and change it to .highlight1 {font-weight:bolder;font-size:6pt} and lo and behold the appearance of all labels with class highlight1 changes accordingly.

Thanks for the update. smile