This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

customizing downloader-template.html and multiple categories ?

Hi

webfilter blocks e.g. categories 113 (extreme) and 163 (cruel).

I use the downloader-template.html with  and javascript.

If just category 113 was hit, it shows "extreme"  - but if two categories were hit, there is nothing.

Has anyone solved this yet, changing the script ?

TY !


This thread was automatically locked due to age.
  • Reproduced and I see the problem.  I'll talk to one of the HTML guys and see if they have a solution.  The problem is not in the proxy but it is in the sample templates we give.

    The system has returned multiple category numbers and the the block page HTML is trying to convert them into category names.  The following code works for single numbers and not for multiple.

    If you do a "View Source" you should see something like:

    600 : "For Kids",
    601 : "History",
    602 : "Moderated",
    603 : "Text/Spoken Only",
    9998 : "Uncategorized",
    9999 : "Categorization failed"
    };

    if (document.getElementById("categoryName") && categories["600,116"]) {
    document.getElementById("categoryName").innerHTML = categories["600,116"];
  • In the custom template html please replace this:


    if (document.getElementById("categoryName") && categories[""]) {
    document.getElementById("categoryName").innerHTML = categories[""];


    with this:

    var blockedCategories = "";
    var blockedCategoriesPretty = "";

    blockedCategories = blockedCategories.split(',');
    blockedCategories.forEach( function(cat, i, all) {
          cat = categories[cat.trim()];
          if (!cat) return;
          if (i 
  • Hi Michael, 

    I tried your solution - but I dont get anything now .. perhaps I did something wrong ? 

    This is how it looks like as by now:






    Kategorie:







  • You removed an extra trailing } when you deleted the section.

    It should look like:


                                    if (document.getElementById("categoryName") && blockedCategoriesPretty) {
                                                    document.getElementById("categoryName").innerHTML = blockedCategoriesPretty;
                                    }