Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

customizing list view

Help
DrSAR
2010-04-24
2013-05-28
  • DrSAR
    DrSAR
    2010-04-24

    I am trying to customize the general appearance of the list view of search results: By editing $defaultFieldsListViewMajor in ini.inc.php I can change the list view when coming through sql searches (i.e. sql_search.php) but not through the general search (search.php).

    Is this intended?

    If so, is there a way to customize search.php list output?

    Cheers, Stefan

     
  • Hi Stefan,

    By editing $defaultFieldsListViewMajor in ini.inc.php I can change the list view when coming through sql searches (i.e. sql_search.php) but not through the general search (search.php).

    This is now how it's meant to be. Your changes to variable '$defaultFieldsListViewMajor' should affect *both*, searches via 'search.php' and 'sql_search.php'. And with my tests this is also the case.

    As an example, if I add, say, ", type" to the end of variable '$defaultFieldsListViewMajor', then perform a search via the Quick Search form or any of the search links on the main page (e.g. one of the "published in…" links or the "My Refs" link), the type columns will be displayed in List View by default. In addition, clicking on the "SQL Search" link in the page footer does also show the type column in the SELECT pattern. Is this not what you're seeing?

    Maybe I'm misunderstanding you? If so, please try to describe in more detail how you'd like the list view to appear by default.

    Thanks, Matthias

     
  • DrSAR
    DrSAR
    2010-04-26

    No this is not what I'm seeing: If I add 'type' as you suggested, a Quick Search or a Simple Search does not result in a List View with type included. If I check 'your query' it doesn't list 'type' as part of the SQL statement. However, if I hit 'SQL search' it will show the 'type' field as part of the SELECT statement.

    So no, we aren't getting the same result. And I'd like to see it work the way it works for you.

    What did I bugger up? This is a recent svn install of 0.9.5; I have update from 0.9.0 following the update procedure which seems to have worked in all other respects. Would you like an account on my install at http://pfeifer.phas.ubc.ca/~stefan/refbase to see for yourself?

    Thanks for your help

     
  • Hi Stefan,

    thanks for the info and the link to your refbase database.

    I add 'type' as you suggested

    Just to be sure, could you please copy the full line from 'ini.inc.php' which contains your specification of variable '$defaultFieldsListViewMajor'?

    Would you like an account on my install

    Thanks for the link, I can try things without an account.

    I just tried it, and for me (as an anonymous user) it seems to work just fine, actually. Example steps to reproduce:

    1. Go to the main page ("Home")
    2. Click the "2009" link in the "published in" line
    3. Notice that the 'type' column is displayed in the list of columns in List View

    Or, alternatively:

    1. Go to the main page ("Home")
    2. Use the Quick Search form in the top right corner to search for, say, "author" contains "Cameron".
    3. Notice that the 'type' column is displayed in the list of columns in List View

    The use of other 'show.php' queries seems to work as well, e.g. the 'type' column gets also displayed for this query:

    http://pfeifer.phas.ubc.ca/~stefan/refbase/show.php?title=tomography

    Do you see the same when not being logged in to the database? And does that differ from when you're logged in?

    Thanks, Matthias

     
  • DrSAR
    DrSAR
    2010-04-26

    I think we're narrowing it down:

    As requested, the line from ini.inc.php is:

    $defaultFieldsListViewMajor = "author, title, year, publication, type"; // e.g. "author, title, year, publication"
    

    Using both your methods "Home"/"2009" and "Home"/Quick Seach(author)="Cameron" gives me the expected type column.

    However, try "Home"/"Simple Search"/author contains "Cameron"
    You should find that there is no type column. Unfortunately, that's the most common method for my searches. But given the beauty of all these new search methods I can change my habits if Simple Search is not supposed to honour $defaultFieldsListViewMajor as intended behaviour.

    There appears to be no difference for logged in users and guest.

    Let me know what you find.

    Thanks, Stefan

     
  • Hi Stefan,

    thanks for the further info. The value of your variable '$defaultFieldsListViewMajor' looks good.

    Using both your methods "Home"/"2009" and "Home"/Quick Seach(author)="Cameron" gives me the expected type column.

    Ok, that's good to hear.

    I can change my habits if Simple Search is not supposed to honour $defaultFieldsListViewMajor as intended behaviour.

    That's correct, the dedicated search pages (Simple Search, Advanced Search & Libary Search) don't use the defaults specified in variable '$defaultFieldsListViewMajor' since these search pages have their own means of specifying which fields shall be displayed in List View (i.e. the leftmost "Show" column).

    That said, it would be nice if the default selection of checkboxes in the "Show" column of the search pages would be set dynamically according to the fields specified in variable '$defaultFieldsListViewMajor'. The search pages belong to the oldest parts in refbase, and there are longstanding plans to redesign at least the Simple Search page (to make it "simpler" and more flexible). I had actually started with this some time ago but it got never finished, and unfortunately I cannot promise a time frame when this will be done.

    So, from your description, it looks as if the feature is working as intended, it's just that the feature isn't as powerful as you expected it to be. ;-) Sorry!

    But maybe we can find a workaround for you, e.g. by simply changing the set of checkboxes that are marked by default in your search pages. Or something similar…

    Matthias

     
  • DrSAR
    DrSAR
    2010-04-26

    I think I get it and I can live with it the way it is. Having been alerted to the Quick Search feature (I now know it was there in 0.9.0 …) in your recent post, I'll start using it this way more often anyway - that's workaround enough for the time being (until, of course, Simple Search page and such will be redesigned by you or the other unsung heroes of web-reference software)

    Keep it up - it's been tremendously helpful for my group already.

    Thanks and best wishes, Stefan.