Menu

Create a Table of Contents for the Category Tree?

Help
2013-06-06
2013-06-26
  • Notis Toufexis

    Notis Toufexis - 2013-06-06

    Hi Mark,

    not that my my large database is online I focus on minor / major enhancements. One problem I have got: my Category Tree is very large, I would like to put a Table of Contents-like list with links at the beginning of the page, linking back to the $catName-links in each cell of the table.

    I modified HTML.php on line 337 to add id's to these hyperlinks and I have succeeded: to all $catName-links have now attribute-id's with $catId as the value (I won't be adding Categories in the future, so I don't need this to be done in the database; I will of course have to manually update the code with every WIKINDX update). I could now link back to them from everywhere in the page.

    I am now stuck cause I can't figure out where and how to add to the beginning of the Category Tree page an html table or

      -element for the TOC, somewhere near line 58 or 67 I guess, but with my practically non-existent PHP-skills I am not coming forward. Any help or hint would be more than welcome.

      Best regards,
      Notis

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-06-07

    Hi Notis,

    Starting at line 66 in core/modules/browse/CATEGORYTREE.php, is the variable $pString. You'll notice that it is appended to (.=) until the complete category tree table of 3 columns is ready to be printed to the browser with GLOBALS::buildOutputString($pString);

    What you need to do (before line 138) is create another variable that is a string holding your ToC HTML (I assume you have this ready to be printed):
    $tocString = "SOME HTML TABLE CODE";
    then, to place the ToC before the main table with a paragraph space inbetween :
    GLOBALS::buildOutputString($tocString . $this->html->p() . $pString);

    NB You might need to fiddle around with table rows etc between the two tables but that should be about it.

    Mark

     
  • Notis Toufexis

    Notis Toufexis - 2013-06-07

    Thank you Mark, works as a charm.

    Thank you also for being so patient and helpful.

    Notis

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-06-07

    ;) That was easy then. Because of the use of tables in wikindx, I'd advise to check in IE which is less forgiving of missing table rows etc. than Firefox etc.

    If you want to play around more with the formatting, the buildOutputString() function is a concatenator so you could do something like:
    GLOBALS::buildOutputString($tocString);
    GLOBALS::buildOutputString($this->html->p() . $this->html->hr() . $this->html->p());
    GLOBALS::buildOutputString($pString);

    Mark

     
  • Joachim

    Joachim - 2013-06-16

    Hi Notis,

    the alphabetic keyword catalogue on your site is a nice feature. I would like to make something like that, too, but didn't come very long. I started creating categories A, B, C, and so on, and put them on resources with keywords beginning with a, b, and c. As you can guess, the categories didn't limit themselves to those keywords, but because my resources usually have more than one keyword, there were masses of other keywords in those categories, too …

    Would you mind to share how to do such a catalogue?

    Thanks in advance
    Joachim

     
    • Notis Toufexis

      Notis Toufexis - 2013-06-16

      Hi Joachim,

      the Category Tree works neatly with Biblio-Uellner mainly because the
      bibliography was already organised alphabetically, each resource belonging
      to a single keyword (repetition of resources across categories is there and
      hasn't yet been eliminated).

      So this is far from perfect from a database organization perspective but it
      fits neatly to the structure of the bibliography (which was actually
      conceived as a print bibliography). Resources were imported to the relevant
      category and since there won't be any category additions in later time
      (unless a restructuring of the whole bibliography takes place), it was
      quite easy to construct the alphabetical ToC at the top of the page with
      Mark's help. Biblio-Uellner is not a typical bibliography, keywords tend to
      be rather long and by far not constructed with the help of authorized
      lists. It's much more a detailed Verschlagwortung in best German style.

      This won't work with multiple keywords per resource; even if you add each
      resource to multiple categories you will end up with keywords appearing
      under the wrong letters (unless Mark finds a way to restrict this).

      My actual intent for the category tree, which was not possible due to time
      restrictions, was to organize the resources in categories and subcategories
      thematically and not alphabetically. You could have for instance a Category
      "Provenance" with the Keywords than appearing alphabetically within the
      category (Frankreich, Japan, USA etc.) (I am borrowing here keywords from
      you database); with Subcategories it might be even possible to break this
      even more to smaller chunks and make it easier for the user to find what he
      is looking for and, perhaps more significantly, acquire a picture for the
      nature and the depth of your bibliography (which by the way is quite
      impressive).

      All the best,
      Notis

      On 16 June 2013 16:42, Joachim hjatr@users.sf.net wrote:

      Hi Notis,

      the alphabetic keyword catalogue on your site is a nice feature. I would
      like to make something like that, too, but didn't come very long. I started
      creating categories A, B, C, and so on, and put them on resources with
      keywords beginning with a, b, and c. As you can guess, the categories
      didn't limit themselves to those keywords, but because my resources usually
      have more than one keyword, there were masses of other keywords in those
      categories, too …

      Would you mind to share how to do such a catalogue?

      Thanks in advance
      Joachim


      Create a Table of Contents for the Category Tree?https://sourceforge.net/p/wikindx/discussion/326884/thread/57f96449/?limit=25#f2a3

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/wikindx/discussion/326884/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Dr. Notis Toufexis • Nότης Τουφεξής
      http://www.toufexis.info
      http://www.toufexis.gr
      http://www.early-modern-greek.org

       
  • Joachim

    Joachim - 2013-06-26

    Thanks for your answer, Notis.

    My actual intent for the category tree, which was not possible due to time
    restrictions, was to organize the resources in categories and subcategories
    thematically and not alphabetically. You could have for instance a Category
    "Provenance" with the Keywords than appearing alphabetically within the
    category (Frankreich, Japan, USA etc.) (I am borrowing here keywords from
    you database); with Subcategories it might be even possible to break this
    even more to smaller chunks and make it easier for the user to find what he
    is looking for and, perhaps more significantly, acquire a picture for the
    nature and the depth of your bibliography

    That was something I thought about, too, but doesn't work either. Given this situation, categories are of little use for me …

    Best
    Joachim

     

Log in to post a comment.