phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] SiteMgr Enhancement


From: Patrick Walsh (mr_e)
Subject: Re: [Phpgroupware-developers] SiteMgr Enhancement
Date: Thu, 10 Oct 2002 22:27:54 -0700
User-agent: Microsoft-Entourage/10.1.0.2006

Chris,

    Sorry for the slow reply -- I'm out of town on vacation at the moment.

    If I understand what you are asking correctly, it would be very easy to
make a "breadcrumb trail".  Let me confirm that I understand what you are
looking for.

    If you have a site with a hierarchical category tree, like this:

RootCategory1
    SubCategory1
        Subsubcategory1
    SubCategory2
RootCategory2
    SubCategory3

    And you were viewing a page called "Page1" in the Subsubcategory1
category, then you would have display something like this:

RootCategory1 -> SubCategory1 -> Subsubcategory1 -> Page1

    where each category links to a table of contents page for that category.

    If this is what you are looking for, it is pretty easily done.

    The easiest thing would be to do this as a block.  But since I haven't
yet tested center blocks, and you will likely want this to be across the
top, that may not work for you.  The really cool way to implement this would
be to provide a new variable to the templates called, for example,
"{breadcrumbs}", and have that automatically return a string like what is
shown above.  

    Here's what you should do to add this functionality.  I would add it to
my todo list, but as long as you're willing...

    In class.ui.inc.php in your sitemgr-site directory around line 142 add a
line like this:

$this->t->set_var('site_header', $this->bo->get_breadcrumbs());

    then edit class.bo.inc.php and add a function get_breadcrumbs();

    The first thing you will need is the page id.  In class.bo.inc.php this
is stored in $this->page->id.  You will find its parent category by looking
at $this->page->cat_id.  Next you will want to get information regarding the
category -- is it the root category?  What is its name?  What is its
parent's name and id?  Etc.  For this information you merely need to create
a "sitemgr.categories_bo" object and do a getCategory() on the cat_id.  With
the returned object, let's call it $catobj, you can retrieve the following:
$catobj->id
$catobj->name
$catobj->description
$catobj->sort_order
$catobj->parent (the id of the parent, which you can learn about by calling
getCategory again)
$catobj->depth (top level categories are depth zero)
$catobj->root (the topmost category id -- the root of the current branch --
if this is a root then id == root)

    And that's all the information you need.  Of course you'll need to edit
your template to include the {breadcrumb} variable.  Let me know if you have
questions.

..Patrick (mr_e)



On 10/8/02 10:23 AM, "W. Chris Shank" <address@hidden> wrote:

> I'm currently using the SiteMgr module and it's working very well. I've
> begun implimenting a breadcrumb trail and it's rather tedious to do this
> all by hand. Since the trail follows this model head_category ->
> sub_category -> page_name, I'm wondering if there is currently anyway to
> get this info, such that any page would know it's trail?
> 
> If not, I'd like to add this functionality. Any recomendations on where to
> start?
> 
> 
> Thanks
> Chris Shank (spastic)
> 
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]