Echo Joomla K2 Item Title in Main Template Using PHP -


i'm trying echo title of current k2 item i'm viewing, echo not occur within k2 template, should show in main site template.

i tried this:

<?php echo $this->title; ?>  

but displays full site title including company name because have set way in main joomla configuration.

i don't want full site title generated 'title' tag in head of website; want generate name of specific item viewing. pretty easy, php knowledge limited.

i realise pretty old. if still looking solution. not elegant want.

firstly, in case weren't aware, can article id anywhere in doing jrequest:getvar('id') use request id url.

$id = jrequest::getvar('id');  $id = explode(':',$id); echo $id[0]; 

the reason exploding because in site using aliases if , echo $id without see in form id:alias.

using method, query database name associated id in k2_items table. create function else in templates folder assign variable echo in template. keeps template clean gives want.

like say, not quick elegant solution work.


Comments