Hello, I would like to add a button in the primary nav linking to another website, is there any mean to do that without passing through a plug-in? I'm trying to figure out a way to do that. Ranto
@jordanc Can you give me an example of syntax that can be used? Because I did not fully understand the sample plugin on Wiki. Or If somebody does have already this kind of plug-in. That would be great. Thanks a lot for your collaboration, Regards, ranto
@ranto Unfortunately beyond the wiki I'm not sure, I've never developed a plugin myself. You may have better luck taking a look at some of the existing plugins in the plugins directory for inspiration.
@jordanc Actually I have a clue but I do not know how to insert a page inside the common_local_url. The plugin should be like this: function showPrimaryNav() { $user = common_current_user(); $this->elementStart('dl', array('id' => 'site_nav_global_primary')); // TRANS: DT element for primary navigation menu. String is hidden in default CSS. $this->element('dt', null, _('Primary site navigation')); $this->elementStart('dd'); $this->elementStart('ul', array('class' => 'nav')); if (Event::handle('StartPrimaryNav', array($this))) { if ($user) { // TRANS: Link to go to an external page $tooltip = _m('TOOLTIP', 'go to mypage'); $this->menuItem(common_local_url('mypage.php'), } Event::handle('EndPrimaryNav', array($this)); } $this->elementEnd('ul'); $this->elementEnd('dd'); $this->elementEnd('dl'); But now how to insert another page inside common_local_url , because statusnet does not accept other page (really weird :( ) BR, Ranto
Comments
Can you give me an example of syntax that can be used?
Because I did not fully understand the sample plugin on Wiki.
Or If somebody does have already this kind of plug-in. That would be great.
Thanks a lot for your collaboration,
Regards,
ranto
Actually I have a clue but I do not know how to insert a page inside the common_local_url.
The plugin should be like this:
function showPrimaryNav()
{
$user = common_current_user();
$this->elementStart('dl', array('id' => 'site_nav_global_primary'));
// TRANS: DT element for primary navigation menu. String is hidden in default CSS.
$this->element('dt', null, _('Primary site navigation'));
$this->elementStart('dd');
$this->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartPrimaryNav', array($this))) {
if ($user) {
// TRANS: Link to go to an external page
$tooltip = _m('TOOLTIP', 'go to mypage');
$this->menuItem(common_local_url('mypage.php'),
}
Event::handle('EndPrimaryNav', array($this));
}
$this->elementEnd('ul');
$this->elementEnd('dd');
$this->elementEnd('dl');
But now how to insert another page inside common_local_url , because statusnet does not accept other page (really weird :( )
BR,
Ranto