PDA

View Full Version : Custom title in the listing detail page



Milea Ionut
December 1, 2014, 11:13 AM
Hello,

Can someone tell me, please, how can I add some custom text in the title from the listing detail page like in the screenshot below?

1162

I've searched and tried with different files but without success.

Thank you in advance!

Viktor
December 1, 2014, 12:25 PM
Hello Milea,

In admin panel you cannot create it. You can build listing title through Admin panel but if you want same custom text for all listings you can add it yourself in ftp. If you want I can show where you can set custom text for title.

Milea Ionut
December 1, 2014, 04:11 PM
I know that in Admin Panel I can't create it. That's what I need. What file do I have to modify?

Thank you!

Milea Ionut
December 1, 2014, 04:34 PM
Another question, please:

I have only 2 categories. Is it possible to add some different custom text for each one?

Thanks!

Viktor
December 2, 2014, 03:53 AM
Hello Milea,

You can create it here: ftp://includes>>controllers>>listing_details.inc.php

find code:


$listing_title = $rlListings -> getListingTitle($listing_data['Category_ID'], $listing_data, $listing_type['Key']);

and after that or instead of this code create condition:



if( $listing_data['Category_ID'] == 'one_of_your_ID' )
$listing_title = $lang['first_phrase'];
else
$listing_title = $lang['second_phrase'];

save and close the file. Then go to Admin Panel >> Languages click button "Add a phrase" and Key = first_phrase, Value what you want to see in title and same for 2nd phrase too.

Milea Ionut
December 2, 2014, 01:27 PM
Thank you!

I've made the changes but I get only the custom text in the listing details and is also changing the URL of the listing with the custom text (this I don't want).

I want the custom text + the one that I've made from the Admin panel but only in the title from the listing details page without changing anything else.

Thanks!

Viktor
December 3, 2014, 03:35 AM
Hello Milea,

ok please move your code bellow. Find condition:



if ( empty($listing_id) || empty($listing_data) || ($listing_data['Status'] != 'active' && $listing_data['Account_ID'] != $account_info['ID'] && !$config['ld_keep_alive']) )


and above add your code:



if( $listing_data['Category_ID'] == 'one_of_your_ID' )
$listing_title = $lang['first_phrase'];
else
$listing_title = $lang['second_phrase'];


Also what did you set instead of: 'one_of_your_ID'
you should set real category ID here. insert code:
echo $listing_data['Category_ID']; then save and refresh listing details and in top you will see category ID copy and insert it instead of 'one_of_your_ID' then remove
echo $listing_data['Category_ID'];

Curtis
December 3, 2014, 05:47 AM
Thank you!

I've made the changes but I get only the custom text in the listing details and is also changing the URL of the listing with the custom text (this I don't want).

I want the custom text + the one that I've made from the Admin panel but only in the title from the listing details page without changing anything else.

Thanks!

Change new code as following to combine custom text with default listing title:



if( $listing_data['Category_ID'] == 'one_of_your_ID' )
$listing_title = $lang['first_phrase'];
else
$listing_title = $lang['second_phrase'];

$listing_title .= ", " . $rlListings -> getListingTitle($listing_data['Category_ID'], $listing_data, $listing_type['Key']);

Milea Ionut
December 4, 2014, 12:56 PM
Thank you! That worked perfect!