Log in | Register | Lost password

Bottom
Bread crumb trail
  • Posted: 12.04.2008, 20:31
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I am new to PN.8 and content.

    I have been investigating the layout problem of subpages in Content. As yet, I have not got my head round PN.8 enough to propose solutions but may I make a proposal for a new element in Content?

    Could there be an option for including bread crumbs on Content pages?

    My exploration has taken me into your mySQL and your table structure design clearly had that in mind by avoiding the need for recursion.

    If I gain a sufficient understanding of your PHP structures I shall offer a code snippet but I am sure you know the SQL one liner to give the trail.

    Thank you for a superb application

    Tony Davis

    I wondered about posting as a feature request but I am a bit of a new boy for that.
  • Posted: 15.04.2008, 20:54
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hi Tony

    Feel free to post this as a new feature request (as well as any other idea you might get). But I do think it is on the list already.

    We had some discussions about the issue: to me it is obvious to use the page structure for breadcrumbs - this would reflect the sitemap. But other people want the categories structure to be used instead. I am still not sure about what we end up with.
  • Posted: 16.04.2008, 11:37
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I have seen breadcrumbs of three kinds. Page structure, Hansel & Gretel (where you have wandered) and categories.

    I would support page structure as the basis for breadcrumbs on two grounds

    1. Page structure is an increasinly common practice and visitors are becoming more and more accustomed to it.

    2. Page structure supports the development of an information architecture for the site. Perhaps that in itself is a sufficient reason for taking this path. Page structure crumb trails encourage designers to proactively consider information architecture rather than figuring it out as an afterthought.

    Apologies for being old

    Tony Davis
  • Posted: 19.04.2008, 21:07
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Without knowing the work that it could entail, I would like to suggest that the type of breadcrumb trail be selectable by the admin. I could see the need to have the breadcrumbs appear either way, depending on the site, how it is used and the admin running the site. Maybe this would be best added as plugins?
  • Posted: 20.04.2008, 08:06
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Could you please explain that to me?

    I think that Hansel and Gretel bread crumbs have no merit at all = would you agree?

    What I do not understand is how category breadcrumbs work. Is it a requirement for such a site that each page belongs to only one category? And, if not, how does one represent membership of several categories? What happens if categories have sub-categories? Perhaps PN.8 has a different meaning of category (to that which I am used to) which disqualifies some of these questions.

    Tony Davis
  • Posted: 20.04.2008, 09:11
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    PN .8 categories are hierarchically built (with nested categories).

    So you can browse through the category tree to see what pages to find in the categories - that way it works fine with multiple categories for a single page.

    The problem is then what bread-crumb to display - and that is why Content has a primary category and a set of secondary categories: only the primary should be used in the breadcrumb.

    I know this will look funny when you have browsed through category A::B::C and it then displays X::Z::Y as the breadcrumb ...
  • Posted: 20.04.2008, 11:13
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I have been looking at your database. Could you tell me if my deductions are correct?

    The categories for each page are held in pn8_content_pagecategory with links to the page_id (I presume in pn8_content_page) and category_id (presume in pn8_categories_category). I think that must be correct.

    The page tree structure seems to be held in pn8_content_page in four field depth, order, left and right. I guess that is a historical phenomenon.

    I am working on a longer post with some examples of how it might be managed using an example I have constructed from my site.

    Thank you for the inspiration.
  • Posted: 23.04.2008, 12:32
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0

    addacumen

    The categories for each page are held in pn8_content_pagecategory with links to the page_id (I presume in pn8_content_page) and category_id (presume in pn8_categories_category). I think that must be correct.

    The page tree structure seems to be held in pn8_content_page in four field depth, order, left and right. I guess that is a historical phenomenon.


    Correct. But nothing historical - what are you refering to?
  • Posted: 23.04.2008, 13:27
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Jorn, thank you. I really hope I am not teaching grandmothers to suck eggs here.

    I have been trying (struggling) to work out how Content works. I really am failing at the PHP (although I believe I am competent at that - its the layer upon layer I cannot get through). So I have been comparing the output with the databases which create it.

    I now hold two opinions.
    • Somewhere pn8_content_page is read to create the Page List and other things. The ORDER BY part of the SELECT statement is the inverse of what is intended. But I cannot find the SELECT to try out my idea.

    • Thinking about the ORDER BY part made me look at the database to identify what I would order it by - the structure seems to be redundant since the operand for ORDER BY could equally well be page_pos, page_setleft and page_setright. I would choose to remove page_pos since it is always available from the ordering of page_setleft. I might also consider removing page_level since it is rarely going to be needed 'raw' and it is easy to calculate from page_setleft and page_setright held as an array in memory.

    I have collected some illustrations of what I mean but I have a problem posting them. I do not have an easy way of posting them on the web so I have collected them as a PDF file. How might I send that to you.
  • Posted: 23.04.2008, 13:44
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    (1) The order by / select is auto-generated through PostNuke's DBUtil library. You can find the list call in pnpageapi.php (getPages).

    (2) "level" is used to quickly calculate indentation in the UI - it cannot be derived from any other value. "position" is initially used to calculate left/right. It might not be needed but I am not sure. "left" and "right" is by no means redundant - google "nested set algorithm". (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html)
  • Posted: 23.04.2008, 18:43
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Apologies. I had found that call but, since I had been unable to find where it was called, had rather given up on it. Looking at it today showed me the diagnostic below. Which yielded the following.

    Code

    SELECT DISTINCT

    page_id AS "id",page_ppid AS "parentPageId",page_title AS "title",page_urlname AS "urlname",page_layout AS "layout",page_categoryid AS "categoryId",page_active AS "active",page_activefrom AS "activeFrom",page_activeto AS "activeTo",CASE WHEN page_active = 1 AND (page_activeFrom <= NOW() OR page_activeFrom IS NULL) AND (page_activeTo > NOW() OR page_activeTo IS NULL) THEN 1 ELSE 0 END AS "isActive",page_inmenu AS "inMenu",CASE WHEN page_inmenu = 1 AND page_active = 1 AND (page_activeFrom <= NOW() OR page_activeFrom IS NULL) AND (page_activeTo > NOW() OR page_activeTo IS NULL) THEN 1 ELSE 0 END AS "isInMenu",page_pos AS "position",page_level AS "level",page_setleft AS "setLeft",page_setright AS "setRight",page_obj_status AS "obj_status",page_cr_date AS "cr_date",page_cr_uid AS "cr_uid",page_lu_date AS "lu_date",page_lu_uid AS "lu_uid",

    transp_title,

    pn_uname

    FROM pn8_content_page

    LEFT JOIN pn8_content_translatedpage t

    ON t.transp_pid = page_id

    AND t.transp_lang = 'eng'

    LEFT JOIN pn8_users usr

    ON usr.pn_uid = page_lu_uid





    ORDER BY setLeft DESC


    I think DESC should be ASC. That would put the tree the right way up. My tree turns out OK but only because I have inverted the left and right sequence.

    The nested set (modified preorder tree traversal) method is attributed to Celko in about 2001. I think it was first publicly described earlier but cannot dig up that reference. I came across it working on DB2 with responsibility for aspects of translating to DB2 from DL/1, a hierarchical data base. The paper you refer to is also at http://www.vbmy…-data-in-mysql which contains the resource list missing in the MySql version. It shows how to derive the things you need (level, position, bread crumb to begin) from left and right though the examples do it as SQL statements. Equally they could be extracted by code if the array were in memory. Perhaps the techniques in http://dev.e-ta…er.net/dbtree/ could be of value in moving pages around within the hierarchy.

    But I am sure you know all this.

    Thank you, I shall slowly get the hang of PN.8

    Best wishes

    Tony D

Template courtesy of Designs By Darren.