How do I change this in the title HTML tag?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
ssandecki
Posts: 11
Joined: Wed Jan 30, 2008 11:01 am

How do I change this in the title HTML tag?

Post by ssandecki »

I love phpmyfaq, it's great for my site. But I need to be able to change the article titles a bit. As you have it set, it displays the faq name then the article question in the title.

I just want to remove the inject faq name from article titles. You know, the titles that appear at the top of IE or Firefox :)

Also, is it possible to have the title for catagories be unique and show the catagory name?
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I change this in the title HTML tag?

Post by Thorsten »

Hi,
I just want to remove the inject faq name from article titles. You know, the titles that appear at the top of IE or Firefox :)
you have to hack the index.php file... just look for $title.
Also, is it possible to have the title for catagories be unique and show the catagory name?
currently: no. sorry.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
ssandecki
Posts: 11
Joined: Wed Jan 30, 2008 11:01 am

Post by ssandecki »

I know about index.php having the {metaTitle} where in the php files can I remove the faq name (set in admin) that is display along with titles in articles.
ssandecki
Posts: 11
Joined: Wed Jan 30, 2008 11:01 am

Post by ssandecki »

Let me rephrase that question....

In index.php you'll see the title is pulled by a string, what php file handles this string so I can remove the titles from showing the faq name and only the faq question.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

yes. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
ssandecki
Posts: 11
Joined: Wed Jan 30, 2008 11:01 am

Post by ssandecki »

Yes?!

Where is the file to edit that php string!
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

which prase do you mean? :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
ssandecki
Posts: 11
Joined: Wed Jan 30, 2008 11:01 am

Post by ssandecki »

Located in template/index.tpl on line three is the below code...

Code: Select all

<title>{title}</title>
That produces a title in the web browser, the default for the home page is the "Title of the FAQ" setting in web administration under the configuration tab.

On article pages, the title is "Title of the FAQ" - <question here>.

I want to remove the "Title of the FAQ" only from article pages, so it only displays the question. You can either tell me how or direct me to the correct scripts to alter.

http://www.civicseo.com is my FAQ if you want to check it out. It is a search engine optimization knowledge database.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

just open index.php and look for this code:

Code: Select all

//
// Found a record ID?
//
if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) == true) {
    $id       = (int)$_REQUEST['id'];
    $title    = ' - ' . $faq->getRecordTitle($id);
    $keywords = ' ' . $faq->getRecordKeywords($id);
} else {
    $id       = '';
    $title    = ' -  powered by phpMyFAQ ' . $faqconfig->get('main.currentVersion');
    $keywords = '';
}
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
ssandecki
Posts: 11
Joined: Wed Jan 30, 2008 11:01 am

Post by ssandecki »

Thanks, issue solved.
Reboot
Posts: 3
Joined: Fri Aug 03, 2007 2:35 pm

Post by Reboot »

I'm having this same issue now, but can't get it resolved. I want to remove the standard title from the IE and FF title window and just leave the title of the FAQ that's being viewed.

Right now it's:

[Title of phpmyFAQ] - [Title of FAQ Record]

I want it to be:

[Title of FAQ Record]

This promotes better SEO with search engines along w/ using the mod_rewrite option.

Here's my code that I've hacked away at in the index.php file, not sure what changes I still need to make to get rid of it the title of my phpmyfaq site.

Code: Select all

//
// Found a record ID?
//
if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) == true) {
    $id       = (int)$_REQUEST['id'];
    $title    = RecordTitle($id);
    $keywords = RecordKeywords($id);
} else {
    $id       = '';
    $title    = '';
    $keywords = '';
}

// 
// found a solution ID? 
// 
if (isset($_REQUEST['solution_id']) && is_numeric($_REQUEST['solution_id']) === true) { 
    $solution_id = (int)$_REQUEST['solution_id']; 
    $title       = ''; 
    $keywords    = ''; 
    $a = $faq->getIdFromSolutionId($solution_id); 
    if (is_array($a)) { 
        $id = $a['id']; 
        $lang = $a['lang']; 
        $title    = RecordTitle($id); 
        $keywords = RecordKeywords($id); 
    } 
} 
Lidio
Posts: 25
Joined: Mon Dec 10, 2007 9:26 pm

Post by Lidio »

Reboot,

if you haven't figured it out, look for

Code: Select all

$main_template_vars = array(
    'title'             => $faqconfig->get('main.titleFAQ').$title,
and remove $faqconfig->get('main.titleFAQ'). part leaving only $title

Lidio.
Reboot
Posts: 3
Joined: Fri Aug 03, 2007 2:35 pm

Post by Reboot »

Lidio wrote:Reboot,

if you haven't figured it out, look for

Code: Select all

$main_template_vars = array(
    'title'             => $faqconfig->get('main.titleFAQ').$title,
and remove $faqconfig->get('main.titleFAQ'). part leaving only $title

Lidio.
Thank you very much. That did the trick.

I changed it to:

Code: Select all

    'title'             => $title.' / '.$faqconfig->get('main.titleFAQ'),
Post Reply