Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#121 2009-06-11 22:43:55
Re: Admin Side Theming! (r3149)
Can’t find where in Remora current author is placed… If it’s not yet, than would be useful if author name is wrapped by some tag, like <span id="author">ghost</span>.
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#122 2009-06-18 17:13:45
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: Admin Side Theming! (r3149)
It is possible to put breadcrumb navigation in a theme?
I’d like to edit the remora theme to include breadcrumbs as i’ve added a new dashboard tab. So it would put like this.
Dashboard > Content > Images
The breadbrumb would ideally be links to. I’m no PHP expert so any help is much appreciated.
Offline
#123 2009-06-18 17:52:11
Re: Admin Side Theming! (r3149)
FireFusion wrote:
It is possible to put breadcrumb navigation in a theme?
Yes. I made a theme called breadcrumb and put this code in breadcrumb.php:
<?php
if (!defined('txpinterface')) die('txpinterface is undefined.');
theme::based_on('classic');
class breadcrumb_theme extends classic_theme
{
function html_head()
{
$js = <<<SF
$(document).ready( function() {
$("#nav li").hover( function() { $(this).addClass("sfhover"); }, function() { $(this).removeClass("sfhover"); } );
});
SF;
return parent::html_head().n.script_js($js).n;
}
function header()
{
global $txp_user;
$out[] = '<div id="masthead"><ul id="nav">';
$crumb = array();
foreach ($this->menu as $tab)
{
$class = ($tab['active']) ? 'tabup active' : 'tabdown inactive';
if ($tab['active']) {
$crumb[0] = array("lbl" => $tab['label'], "evt" => $tab['event']);
}
$out[] = "<li class='primary {$class}'><a href='?event={$tab['event']}'>{$tab['label']}</a>";
if (!empty($tab['items']))
{
$out[] = '<ul>';
foreach ($tab['items'] as $item)
{
$class = ($item['active']) ? 'tabup active' : 'tabdown2 inactive';
if ($item['active']) {
$crumb[1] = array("lbl" => $item['label'], "evt" => $item['event']);
}
$out[] = "<li class='secondary {$class}'><a href='?event={$item['event']}'>{$item['label']}</a>";
}
$out[] = '</ul>';
}
$out[] = '</li>';
}
$out[] = '<li id="view-site" class="primary tabdown inactive"><a href="'.hu.'" target="_blank">'.gTxt('tab_view_site').'</a></li>';
if ($txp_user) $out[] = '<li id="logout" class="primary tabdown inactive"><a href="index.php?logout=1" onclick="return verify(\''.gTxt('are_you_sure').'\')">'.gTxt('logout').'</a></li>';
$out[] = '</ul></div>';
$out[] = '<div id="messagepane">'.$this->announce($this->message).'</div>';
// Breadcrumb output start
$crumbout = array();
foreach($crumb as $critem) {
$crumbout[] = '<a href="?event='.$critem['evt'].'">'.$critem['lbl'].'</a>';
}
array_unshift($crumbout, '<a href="?event=dashboard">Dashboard</a>');
$out[] = '<div class="crumbnav">'.join(' » ', $crumbout).'</div>';
// Breadcrumb output end
return join(n, $out);
}
function footer()
{
return '<div id="end_page">'.n.
'<a href="http://textpattern.com/" id="mothership"><img src="theme/classic/carver.gif" width="60" height="48" border="0" alt="" /></a>'.n.
graf('Textpattern · '.txp_version).n.'</div>';
}
function manifest()
{
global $prefs;
return array(
'author' => 'Team Textpattern',
'author_uri' => 'http://textpattern.com/',
'version' => $prefs['version'],
'description' => 'Textpattern Remora Theme',
'help' => 'http://textpattern.com/admin-theme-help',
);
}
}
?>
It’s a bit convoluted and there’s undoubtedly a better way. Just decide where you want the nav to sit (move the bit between breadcrumb output start and breadcrumb output end.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#124 2009-07-01 10:04:20
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: Admin Side Theming! (r3149)
I’m having a problem in Firefox 3.5 with Remora. If you move off the dropdown menu at certain angles (or maybe speeds) they don’t close until you rehover and move off again. It’s very annoying.
Offline
#125 2009-07-01 19:25:59
Re: Admin Side Theming! (r3149)
FireFusion wrote:
with Remora. If you move off the dropdown menu at certain angles (or maybe speeds) they don’t close until you rehover and move off again.
I noticed that. I think it’s a speed thing and it is a bit of a pest. I tried to implement a theme that delayed the onset of the dropdown by a couple of hundred milliseconds (a bit like hoverintent) but I couldn’t get it to work properly :-( If anyone knows a neat way of doing this it’d be cool.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#126 2009-07-03 19:55:46
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: Admin Side Theming! (r3149)
Wet you’ll need to turn the z-index up on the dropdowns of the remora theme. Plugin’s like Rah_sitemap show content over the top of them.
Offline
#127 2009-07-04 00:45:27
Re: Admin Side Theming! (r3149)
If we all really wish with all our might, maybe there won’t be any more MS browsers.
Offline
#128 2009-07-04 04:53:30
Re: Admin Side Theming! (r3149)
I’ve been looking at the code, and I’m a little concerned – It looks like there is different markup between themes and that’s actually pretty bad for consistency and plugin compatibility. Am I going to have to write different a different plugin “hook” for each theme?
How is this being handled?
Offline
#129 2009-07-04 05:40:26
Re: Admin Side Theming! (r3149)
I think we’ve got most of the bases covered with register_tab(), the various events sent by all pluggable_ui() instances, and the admin-side events from pre-4.2.0. What additional hook would you suggest? All ears…
Offline
#130 2009-07-04 05:44:21
Re: Admin Side Theming! (r3149)
I mean DOM style hooks. If there isn’t consistent HTML between admin pages, creating plugins that use JS to manipulate the html is going to prove problematic.
Offline
#131 2009-07-15 23:23:54
Re: Admin Side Theming! (r3149)
….any thoughts on the above?
Offline
#132 2009-07-24 10:00:59
Re: Admin Side Theming! (r3149)
r3255 introduces theme-independent events for header and footer. Theme-independent DOM hooks were a contradiction per se, as the purpose of themes is to render specific HTML.
Offline
#133 2009-07-25 06:11:19
Re: Admin Side Theming! (r3149)
No, what I’m saying is that if I’m going to insert something somewhere as a plugin-writer, I expect the markup to be the same from theme to theme. The differing markup is going to make it that much harder. You don’t need to restyle the HTML for every single theme (e.g., look at csszengarden.com.) With properly classed/id’d html, all that needs to be changed is the CSS. I think the direction it’s going is entirely wrong.
Offline
#134 2009-08-03 04:56:30
Re: Admin Side Theming! (r3149)
Noticed: The more the things change, the more they’re the same.
Offline
#135 2009-08-03 05:35:51
Re: Admin Side Theming! (r3149)
TheEric wrote:
No, what I’m saying is that if I’m going to insert something somewhere as a plugin-writer, I expect the markup to be the same from theme to theme.
The only way to have markup consistency in 4.2 is to create it yourself through pluggable_ui(). However, you’ll still have differing displays based on the theme, so plugin authors will need to be explicit about their styling for inserted elements. It’s another step:
4.0.x:
- Inject JS into
<node>
4.2.x:
- Create the target HTML node
- Inject JS into
<node>
The differing markup is going to make it that much harder. You don’t need to restyle the HTML for every single theme (e.g., look at csszengarden.com.) With properly classed/id’d html, all that needs to be changed is the CSS.
I think pluggable_ui() provides some much needed admin hooks (thanks wet), but I wholeheartedly agree with you about the overall admin-side themes (which are distinct from pluggable_ui()).
Offline