Forums

getDocument is returning menu title, not article title

designsedge 24 Oct, 2016
I have a form where I want to capture the articles title - Sometimes it seems to miss the mark (When articles are tied to a menu item) the following code is returning the menu title, instead of the article title:
<?php
$jdoc = JFactory::getDocument();
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $jdoc->getTitle(); ?>' />
<input type='hidden' name='page_url' id='page_url' value='<?php echo $jdoc->getBase(); ?>' />


Checked database (is correct) as well as verified that schema is up to date.
~~~
Couple of coffees headed your way Bob - thanks for such a versatile system.
Mike (Designs Edge)
This topic is locked and no more replies can be posted.