Sales Question?
Welcome, Guest
  • Page:
  • 1
  • 2

TOPIC: The article title in a hidden field

The article title in a hidden field 4 years, 1 month ago #4810

This question has been asked from others before...with no answer. Grateful if someone can help.

With the plugin for BreezingForms you can put any form inside a content article.

But when I have the same type of form for other articles aswell, then I will not know from which article the form was sent from. Therefor I need to have at least the title of the article inside the form. Either as inside an input field or as a hidden one.

/S
  • Betrakta
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 1

Re:The article title in a hidden field 4 years, 1 month ago #4813

First: click Edit form/Form pieces
click: Before form/Library
choose: FF::ff_InitLib

Then use for value

<?php 
$id = ff_getParam('ff_contentid');
if (is_numeric($id))
    return ff_selectValue("select title from #__content where id=$id");
?>


...to get a field to write out the article title


/Steve
  • Betrakta
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 1
Last Edit: 4 years, 1 month ago by Betrakta.

Re: The article title in a hidden field 1 year, 8 months ago #48838

Sorry for bumping this old thread, but the solution below does not seem to work anymore.

Does anyone know if there is still a way to return the article/page title into the value of a hidden field, using Breezingforms in Joomla 1.6?

Hope someone can help...

Thanks,
Frank
  • frankscl
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0

Re: The article title in a hidden field 1 year, 8 months ago #48840

Excuse the BUMP again - I have a found a method that works and wanted to share:

Put the following code in the value of the hidden field:
<?php 
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
if ($option=="com_content" && $view=="article") {
    $ids = explode(':',JRequest::getString('id'));
    $article_id = $ids[0];
    $article =& JTable::getInstance("content");
    $article->load($article_id);
    return $article->get("title");
}
?>


And it should return the title of the article you are currently viewing.

Frank
  • frankscl
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0

Re: The article title in a hidden field 1 year, 7 months ago #56803

In Joomla 1.7 it's far more simple, just use this code:

<?php return JFactory::getDocument()->getTitle(); ?>
  • vvallace
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0

Re: The article title in a hidden field 1 year, 3 months ago #67353

Working!. Thank you both for those 2 codes. You are great!
  • ventasman
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
  • Page:
  • 1
  • 2
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.41 seconds

Flatrate Membership: Professional Subscription

Get lifetime access to all of our products and 1 year of professional support -- for just $199 USD. No limits on domains!. Includes all of our current and future Joomla!® extensions, WordPress® plugins and Joomla!® templates.

Get it from here

Recurring Customer Discount - 50% Off!

Get a 50% discount on our Professional Subscription if you have been purchasing a subscription from us in the past -- no matter when. The Professional Subscription includes all of our current and future Joomla!® extensions, WordPress® plugins and Joomla!® templates.

How to receive the discount:

  • Purchase a basic 1-Year Subscription from here.
  • Send us a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and proof of your old purchase.
  • We will then upgrade your account to the Professional Subscription.

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our 1-Year Basic or Professional Subscription plans.

How to receive the discount:

  • Send us a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with a proof of purchase (for example a paypal receipt).
  • Await payment instructions and enjoy your membership!

About

Crosstec GmbH & Co. KG

Hohenzollernring 57

50672 Cologne, Germany

Imprint