canonical path for CCv5 button

teldrive 22 Mar, 2016
Hi
let me explain this issue, in a CC ->front list->table i have some standard buttons
[code]<?php
$this->view->Toolbar->addButton("toolbar-button-remove","/es/component/chronoconnectivity5/?cont=lists&ccname=cc_list&act=delete","DEL", "/libraries/cegcore/assets/images/toolbar/remove.png", "submit_selectors");
?>[/code]
i tried to use a canonical path in order to avoid folder dependencies
[color=#FF0000]"/es/component/chronoconnectivity5/?cont=lists&ccname=cc_list&act=delete"[/color]
this links works when page is in root folder but each year I have to move this web page into a new folder to allow access to it ocassionally like http://mywebpage.com/2014/
httpdocs/2014/
httpdocs/2015/
httpdocs/current

all joomla menu links work but button's CC doesn't work
can you help me?
GreyHead 23 Mar, 2016
Answer
Hi Teldrive,

Please try this - it should work regardless of the site location
<?php
$url = JURI::root().'es/component/chronoconnectivity5/?cont=lists&ccname=cc_list&act=delete';
$this->view->Toolbar->addButton("toolbar-button-remove", $url, "DEL", "/libraries/cegcore/assets/images/toolbar/remove.png", "submit_selectors"); 
?>
I would probably use the full URL there in place of the SEF version
<?php
$url = JURI::root().'index.php?option=com_chronoconnectivity5&cont=lists&ccname=cc_list&act=delete';
$this->view->Toolbar->addButton("toolbar-button-remove", $url, "DEL", "/libraries/cegcore/assets/images/toolbar/remove.png", "submit_selectors"); 
?>

Bob
teldrive 23 Mar, 2016
It works fine, thanks a lot Bob
This topic is locked and no more replies can be posted.