ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

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.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com