PDA

View Full Version : Ad tittle format



Aleksandar Apostolovski
January 13, 2019, 11:09 PM
Where can I edit the text format of an ad tittle if my build form for the ad tittle is: Make/Model and Ad Tittle.
Example of an ad tittle: Audi, A3, Nice car from a second owner

I want to edit the text format so the ad tittle could be: Audi A3 - Nice car from a second owner

Rudi
January 14, 2019, 02:16 AM
Hello,

You should use Title Form for your primary category: Categories > Categories > your primary or parent category > Build > Build Listing Title > add Category (Make/Model) and Title fields

Aleksandar Apostolovski
January 14, 2019, 06:14 AM
Hi Rudi, my title is already built like that.
I want to edit the way it's shown, actually I want to delete the commas that are shown in the title.
Example: Audi, A3, Nice car...

Rudi
January 14, 2019, 06:25 AM
To remove all the commas in the title go to ftp > includes > classes >

rlListings.class.php > public function getListingTitle

find and change:


$title .= $item ? $item . ', ' : '';


to:


$title .= $item ? $item . ' ' : '';



and change:


$title = substr($title, 0, -2);


to:


// $title = substr($title, 0, -2);



then go to rlCommon.class.php > public function adaptValue > case 'select'

change:


$out .= $lang['categories+name+' . $parent] . ", ";


to:


$out .= $lang['categories+name+' . $parent] . " ";

Aleksandar Apostolovski
January 14, 2019, 06:10 PM
Once again thank you very much Rudi!
For anyone interested in future about this, I deleted the comma and put empty space instead just deleting the comma because in that case it would shortened the title at the end for the last letter/symbol.

Rudi
January 15, 2019, 02:11 AM
You're welcome,

As you can see I didn't remove the space, only comma :)

Aleksandar Apostolovski
January 15, 2019, 06:19 AM
Yes, but I meant to say it needs to be two empty spaces

Wei Hong
January 15, 2019, 06:41 AM
Yes, but I meant to say it needs to be two empty spaces

Rudi meant that you should leave the space and delete the comma only in the code.

Aleksandar Apostolovski
January 15, 2019, 06:46 AM
I mentioned this because I copy/pasted his code and I got the shortened title ;)

Wei Hong
January 16, 2019, 01:38 AM
I mentioned this because I copy/pasted his code and I got the shortened title ;)

Yes thats why he told you to look at the space. You can see in his code there is still space. When you copied it, it probably removed the space? But you know how to fix it by now, just make a space in your code.

Aleksandar Apostolovski
January 16, 2019, 06:22 AM
You probably haven't read, I meant to say it needs to be two empty spaces.
If you copy his code it's just one.

Wei Hong
January 16, 2019, 07:58 AM
Not sure I know what do you mean by two empty spaces. I thought you mean A B C <--- 2 empty spaces, 1 between A and B, 1 between B and C. Or A B C <-- 2 empty space between A and B, and B and C?

Aleksandar Apostolovski
January 16, 2019, 08:11 AM
Instead this:
$title .= $item ? $item . ' ' : '';
Should use this:
$title .= $item ? $item . ' ' : '';

Two empty spaces between the ' symbol.
Bit confusing :)

Aleksandar Apostolovski
January 16, 2019, 08:12 AM
The forum cuts the one space :))

Wei Hong
January 16, 2019, 08:25 AM
That's what I was trying to say. You add or remove the space till you see fit.

Aleksandar Apostolovski
January 16, 2019, 08:30 AM
That's right, and the point is reached. Now everyone could understand easier :)

Viktor
January 16, 2019, 11:57 AM
I suggest you create a new ticket with the problem. Maybe you forgot to enable the rewrite module on your server or some other problem.

Aleksandar Apostolovski
January 16, 2019, 12:04 PM
Viktor, I solved the problem and thanked Rudi for that at the start of this thread. Me and Wei just discussed about some tiny details :)

Wei Hong
January 17, 2019, 02:17 AM
That's right, and the point is reached. Now everyone could understand easier :)

Glad it worked out well :D

Horizon
December 31, 2023, 03:52 AM
To remove all the commas in the title go to ftp > includes > classes >

rlListings.class.php > public function getListingTitle

find and change:


$title .= $item ? $item . ', ' : '';


to:


$title .= $item ? $item . ' ' : '';



and change:


$title = substr($title, 0, -2);


to:


// $title = substr($title, 0, -2);



then go to rlCommon.class.php > public function adaptValue > case 'select'

change:


$out .= $lang['categories+name+' . $parent] . ", ";


to:


$out .= $lang['categories+name+' . $parent] . " ";


I'm not finding this in 4.9.2 rlCommon.class.php. Is this in a new location? I'm trying to remove the comma between category, subcategory in title so it's just category subcategory (no comma)

Rudi
January 1, 2024, 07:05 PM
Hello,

all is the same, try to refresh the system cache via Common > Refresh

Horizon
January 1, 2024, 09:52 PM
OK, thanks. Got it now. I was trying to search exact and not finding it.

The 2019 post points to:

$out .= $lang['categories+name+' . $parent] . ", ";
$out .= $lang['categories+name+' . $parent] . " ";

which is now a bit different:

$out .= $rlLang->getPhrase('categories+name+' . $parent, $preferred_lang) . ', ';
$out .= $rlLang->getPhrase('categories+name+' . $parent, $preferred_lang) . ' ';

Thanks again!