Article ID in Article Title

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
zcampbell
Posts: 6
Joined: Thu Sep 10, 2015 4:03 pm

Article ID in Article Title

Post by zcampbell »

I am looking for a way display the article id in the title of the article. Something like "123. Article Name Here". I am working on some ISO 9001 documentation and it would be much easier to use the already created Id in the process. Thanks and any help, as always, is appreciated.
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Article ID in Article Title

Post by Thorsten »

Hi,

that's possible, which version do you use. I can provide a "hack".

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
zcampbell
Posts: 6
Joined: Thu Sep 10, 2015 4:03 pm

Re: Article ID in Article Title

Post by zcampbell »

Awesome! I'm currently running 2.8.25.
Last edited by zcampbell on Wed May 18, 2016 8:21 pm, edited 2 times in total.
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Article ID in Article Title

Post by Thorsten »

Hi,

change this line https://github.com/thorsten/phpMyFAQ/bl ... x.php#L283 to

Code: Select all

    $title           = ' - ' . $id . ' - ' . $faq->getRecordTitle($id);
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
zcampbell
Posts: 6
Joined: Thu Sep 10, 2015 4:03 pm

Re: Article ID in Article Title

Post by zcampbell »

I'm sorry I should have been more specific. What you have above works great, but I also wanted to have the id in the name whenever its displayed. ex When clicking on a category all of the articles are numbered "$id. $faq->getRecordTitle($id)".Something similar to http://puu.sh/oWIq9/6289711ea8.png and http://puu.sh/oWIzF/6f6b7c9ed2.png
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Article ID in Article Title

Post by Thorsten »

Hi,

okay... but there are a lot of places there the ID have to be added.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
zcampbell
Posts: 6
Joined: Thu Sep 10, 2015 4:03 pm

Re: Article ID in Article Title

Post by zcampbell »

You don't have to do any more. I'm going to try and find a simpler solution. Most likely creating a script to add the id to the title in the database. Thanks for your help anyway.
Post Reply