How to capture content title?

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
serkany
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Nov 28, 2006 11:59 am

How to capture content title?

Post by serkany » Mon Sep 03, 2007 4:05 pm

Hi,

I want to capture content title in a form so that I can understand for which content the form is sent. I can capture the url by the following

return $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

but how can I capture the title of the content item? The form will be inside the content item via a mambot.

Or if you know any form component that can do this easily, that'll also help.

Thanks in advance...
Serkan

User avatar
Tonie
Joomla! Ace
Joomla! Ace
Posts: 1585
Joined: Thu Aug 18, 2005 7:13 am
Contact:

Re: How to capture content title?

Post by Tonie » Mon Sep 03, 2007 7:28 pm

Moving to coding 101 Q/A
Antonie de Wilde - Forum admin

User avatar
jalil
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Wed Jul 04, 2007 4:54 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to capture content title?

Post by jalil » Tue Sep 11, 2007 3:18 am

serkany wrote:The form will be inside the content item via a mambot.


i think you yurself provided the anwer. you can get the bot to pick up the title and keep it in the form as input type=hidden.  :D

serkany
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Nov 28, 2006 11:59 am

Re: How to capture content title?

Post by serkany » Tue Sep 11, 2007 2:38 pm

:) Yes but how can I pick up the title, that's my problem...What's the variable for that?

I'm trying to use RSForm and it has a bot to display the form in the content item. I put the following code

global $mainframe;
    $_POST['form']['tur'] = $mainframe->_head['title'];

to be processed after submit but it gives back the title of the overall site not the content title.

Any idea how to solve this?

Regards,
Serkan

User avatar
jalil
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Wed Jul 04, 2007 4:54 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to capture content title?

Post by jalil » Wed Sep 12, 2007 12:10 am

why not can use the OnPrepare Content event ( or somethng like that name, don't know exactly the name ) in your bot to get the contents and then search for content titles and then you will be able to do someting with it. There a family of them OnAfterContent, OnBefore Content.

User avatar
jalil
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Wed Jul 04, 2007 4:54 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to capture content title?

Post by jalil » Wed Sep 12, 2007 12:24 am

serkany wrote: :) Yes but how can I pick up the title, that's my problem...What's the variable for that?


i do not know of any variable used for the title, but someone experienced in this area may shout at this stage that there is one hopefully. i think the title is just put out as a



Post Reply