Tabular display (9 posts)

  1. snips56
    Posted 2 years ago #

    Is there a way to set the display from search to generate tables? With a large library, having results returned in a single column of results can mean a large page to scroll through or a lot of paging.


  2. Robert Heller
    Plugin Author

    Posted 2 years ago #

    This could probably be handled with clever stylesheet code, much in the same way the WP backend dashboard is handled.

  3. snips56
    Posted 2 years ago #

    Don't suppose you have some of that clever stylesheet code around??? :-)

    Perhaps for a future iteration, you could create a settings items for the search page (or maybe just an option on the inline parameters) that would allow you to choose the number of columns, like so many other WP plugins do?

    Thanks for this - I believe it will be helpful for our little woodworkers association, but would be even more useful if we could generate multiple columns and an upload/media library link function.

  4. Robert Heller
    Plugin Author

    Posted 2 years ago #

    Don't suppose you have some of that clever stylesheet code around??? :-)

    Nope. I barely understand stylesheets myself. Misquoting Dr. "Bones" McCoy: "Damit Jim, I'm a programmer, not a web designer!".

  5. snips56
    Posted 2 years ago #

    OK - well maybe I'll take a crack at that. Can you tell me what php or js file generates the output of search results?

  6. Robert Heller
    Plugin Author

    Posted 2 years ago #

    There is no js code involved. The short codes are implemented in the short_codes.php in the includes directory. The actual search code is in the database_code.php file.

  7. zoltanherczog
    Posted 1 year ago #


    I did some changes in the default code, so the result is something like this:

    1. Italo Calvino: Végül arra száll egy holló
    2. Ráth-Végh István: A könyv komédiája
    3. Ulrich Plenzdorf: Die neuen Leiden des jungen W (suhrkamp taschenbuch)
    4. Bárczi Géza: A Halotti Beszéd nyelvtörténeti elemzése
    5. Gulya János: A vízimadarak népe: Tanulmányok a finnugor rokon népek élete és műveltsége köréből

    "indexnumber.<tab>Author:Title" for each line, where "Title" is the only link to the item (but i can change it for you if needed) and it doesn't shows the image of the item you uploaded.

    So, the changes in /includes/short_codes.php should be after "default:":

    	$result .= '<span class="weblib-item-brief weblib-item-info weblib-item-element">';
    	$result .= $item->author();
    	if ($item->callnumber() != '') {
    	  $result .= '<br />'.__('Call Number:','web-librarian').'&nbsp;'.$item->callnumber();
    	$result .= ': ';
    	if ($moreinfourl != '') {
    	  $result .= '<a href="'.add_query_arg(array('barcode' => $barcode),
    	$result .= $item->title();
    	if ($moreinfourl != '') {$result .= '</a>';}

    and changes in the /css/front.css should be:

    .weblib-item-index {
      font-size: 100%;
      padding: 0px 4px;
      text-align: left;
      width: 5%;

    I reduced the index number's size cause it looks better when you have shorter lines.

    Please, let me know if it's okay for you!

  8. snips56
    Posted 1 year ago #

    Thanks zoltanheczog

    Unfortunately, while that tightens up the listing, it isn't what I was asking for. I was looking for a tabular format - that is, a table - with rows and columns. That way I should be able to see four (or whatever number I wish) book images across the first row, then a row break and four more and so on until I reach the pagination limit - maybe 20 books at a time in five rows of four columns. I don't want to lose the thumbnails, but rather would like to not have them in a single column. I hope this makes sense. Thanks again.

  9. Lee Jones
    Posted 1 year ago #

    I did something similar with columns (I didn't want to parse with an "each()" loop). You can inspect the elements on my landing page (still a work in progress) at library dot cypresschurch dot net. http://library.cypresschurch.net/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WebLibrarian
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.