Reply New Topic
3/12/2009 12:10:17
#1
Offline
Home away from home

[Trac Ticket #21] ACP Breadcrumbs in 1.3

After discussing with Phoenyx and his solution for a dirst fix for the lack of ACP breadcrumbs. We have concluded that this feature needs to be enhanced - and it needs to be done for 1.3 as the new ACP theme requires breadcrumbs to be working.

Here is the fix Phoenyx has come up with so far.

kernel/module.php
function displayAdminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1) [line 277]


before the function is closed add
global $icmsAdminTpl;
$icmsAdminTpl->assign('breadcrumb', $breadcrumb);


This will pass the breadcrumbs that the module declares - however - this does nothing if the adminmenu is not constructed with IPF, and as it stands the modules menus that are being constructed with IPF are only passing the current pagename - which is fine. However - all of the system pages are only passing the term "System" as the pagetitle, so my current approach is lacking any real depth.

I heartily believe that system pages should pass a legitimate pagetitle. so if you are in Version Checker - the pagetitle should be Version Checker and not just System.

Anyway - here is the constructor for the breadcrumbs I have assembled in the template.

<a href="<{$icms_url}>/admin.php">ACP Home</a> <span style="margin: 0px 4px;">></span> <{if $icms_dirname != 'system'}><a href="../"><{$icms_dirname}></a> <{if $breadcrumb != ''}><span style="margin: 0px 4px;">></span> <strong><{$breadcrumb}></strong><{/if}><{else}><strong><{$icms_pagetitle}><{/if}>


Now as you can see - I am checking against the active directory being system - which is the only way I could think of to assure that the pagetitle was not always being displayed for system pages - the issue here is that modules make use of the system module for a lot of their config pages... which means that the breadcrumb is going to report false information regarding the actual steps taken to reach the current page from the ACP Index.

Solution: no idea - ideally <{$breadcrumb}> should automatically be generating an actual breadcrumb trail without having to <{if/else/fake}> it.

Thoughts?

I have opened a ticket for this issue. [t:852]


Edited by UnderDog on 3/3/2011 5:24:12

3/12/2009 13:12:13
#2
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

I thought of a breadcrumb class which we could introduce to handle that providing methods for adding a deeper level (e.g. Profile >> Audio >> Edit) instead of constructing the breadcrumb in the module itself every time. This might make sense, however it might also make no sense.

The other option would be to take this as a reason to clean all breadcrumbs created systemwise.

_________________
the german icms website : www.impresscms.de

3/12/2009 13:15:10
#3
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

I like the idea of a single class that inspects the page and constructs the breadcrumb. Although - I am open for anything that actually works :)


3/12/2009 20:04:07
#4
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

Have a look at the xoopstree class - it is used by several modules when there is a hierarchy of content (category - subcategory - item). There is also a breadcrumb separator language constant already defined.

_________________
Christian Web Resources
Facebook

4/12/2009 0:36:32
#5
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

Xoopstree is there, but if you read the methods it offers, you'll notice it seems more suitable for News module category selector box, not for breadcrumbs.

Besides that, I wouldn't like breadcrumbs rendering to be hardcoded, that is, I don't like:

<{$breadcrumbs}>

This is the way some modules render their own breadcrumbs, forcing any designer to hack the module if the want the breadcrumbs HTML to be different. I'd prefer breadcrumbs rendering to be controlled by a template. That is, $breadcrumbs should be an array that we process in the theme, like this:

<{includeq file=$theme_name/breadcrumbs.html breadcrumbs=$breadcrumbs }>

Besides offering more control during breadcrumbs render, the template would be reusable. Maybe our site's information requires a bi-dimensional or three-dimensional classification system, who knows.

_________________
If you can't understand what I'm saying, you're not geek enough
ISegura.es

4/12/2009 11:29:25
#6
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

Don't forget: This is all about the backend (ACP). We're not talking about the frontend here.

We could also name it $acp_breadcrumb. There's no real difference in the code for that .

_________________
the german icms website : www.impresscms.de

4/12/2009 11:32:42
#7
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

I do understand where he is coming from - being able to control the delimiters and styleing in the breadcrumbs would be nice.

At this point - I would be happy if it just worked :)

I will wait and complain about how it works later down the line. :lmao:


5/12/2009 17:55:03
#8
Offline
Home away from home

Re: ACP Breadcrumbs in 1.3

Citaat:


Phoenyx wrote:
Don't forget: This is all about the backend (ACP). We're not talking about the frontend here.

We could also name it $acp_breadcrumb. There's no real difference in the code for that .



Done properly, it would apply to all areas of the site, without having to duplicate code and adjust it for a variation.

_________________
Christian Web Resources
Facebook

3/3/2011 3:39:59
#9
Offline
Webmaster

Re: ACP Breadcrumbs in 1.3

This is related to ticket #21.

Is there any news/progress on this?

_________________

Me on OpenHub


21/3/2011 13:41:52
#10
Offline
Webmaster

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

I've checked in the beta release, and the breadcrumbs are still having the same issues.

Anyone that can have a look into this?

_________________

Me on OpenHub


21/3/2011 14:53:24
#11
Offline
Home away from home

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

Is this of any help?


/**
* Breadcrumb
*
* Managing page breadcrumb
*
* @copyright The ImpressCMS Project http://www.impresscms.org/
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @category ICMS
* @package View
* @subpackage Breadcrumb
* @author marcan <marcan@impresscms.org>
*/
class icms_view_Breadcrumb {

private $_tpl;
private $items;

/**
* Constructor
* @param array $items An array of items for the breadcrumb
*/
public function __construct($items) {
$this->items = $items;
}

/**
* Adds the breadcrumb items to the template
* @param boolean $fetchOnly Whether to display the breadcrumbs, or not
*/
public function render($fetchOnly = FALSE) {

$this->_tpl = new icms_view_Tpl();
$this->_tpl->assign('icms_breadcrumb_items', $this->items);

if ($fetchOnly) {
return $this->_tpl->fetch('db:system_breadcrumb.html');
} else {
$this->_tpl->display('db:system_breadcrumb.html');
}
}
}

_________________
Christian Web Resources
Facebook

22/3/2011 1:56:21
#12
Offline
Home away from home

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

For both ACP & Frontside? Lets try it out .. and make it so if good


22/3/2011 4:43:23
#13
Offline
Home away from home

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

I am not very familiar with 1.3 yet, but it looks like that is only assigned to icm_tpl and not admin_tpl. Yes?


22/3/2011 7:07:05
#14
Offline
Home away from home

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

This was in 1.2.x (class/icmsbreadcrumb.php)

I don't see the breadcrumb template inside any other template - it would need to be added, along with the assignment of the values.

_________________
Christian Web Resources
Facebook

24/3/2011 12:45:08
#15
Offline
Webmaster

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

If I read the discussion correctly (thanks skenow for pointing that out), Will and Phoenyx would like the breadcrumbs to be automatic. Nachenko would like to pass an array to the breadcrumb class, as that would be more flexible.

If that is the case, these are two opposing things. We'll need to agree on a solution, and then implement it.

Skenow posted a proposal of a class. Would that class be a good start, or are there things that need to be added?

_________________

Me on OpenHub


7/4/2011 14:34:31
#16
Offline
Webmaster

Re: [Trac Ticket #21] ACP Breadcrumbs in 1.3

Bumping this one. I guess if no response is given to this, then the current implementation in the 1.3 beta is ok.

If not, let me know asap. :thumbup:

_________________

Me on OpenHub


Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.