[SOLVED] Profile page title

13 years 6 months ago #144897 by frankk
[SOLVED] Profile page title was created by frankk
This will seem like deja-vu as I've seen many posts referring to this, but have yet to find an answer to solve it.

I have the CB Random User module installed which shows a random user(as you may have guessed) every time the page gets loaded. When clicking on the random name given, it shows the user's profile page

My problem is: When it shows the user's profile page, the title of the page is [firstname] [lastname] - [sitetitle]

All I want is to remove firts and last name from there.

Post edited by: krileon, at: 2010/11/16 20:25

Please Log in to join the conversation.

13 years 6 months ago #144908 by krileon
Replied by krileon on topic Re:Profile page title
To do this you'll need to edit comprofiler.html.php and within the profile display function (userProfile) edit the title displayed ($_CB_framework->setPageTitle). Alternatively you can change the name display format within CB configuration to something like Username and username will display instead of the users actual name.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 5 months ago #146339 by jakobe75
Replied by jakobe75 on topic Re:Profile page title
I need pretty much the same thing.

As per your instructions above I can easily change the code from.

$_CB_framework->setPageTitle( cbUnHtmlspecialchars(getNameFormat($user->name,$user->username,$ueConfig)));


into something like this:

$_CB_framework->setPageTitle(MyAwesomeWebsite.com);

But how to bring in a cb field like "Profile ID:[user_id]"

so the page would display

My Awesome Website.com Profile ID:126



and how do I keep the dot and the spaces in the words?
example:
MyAwesomeWebsite.com turns into MyAwesomeWebsitecom


Should I start a new thread?

Please Log in to join the conversation.

13 years 5 months ago #146369 by krileon
Replied by krileon on topic Re:Profile page title

But how to bring in a cb field like "Profile ID:[user_id]"

The $user object is provided so you'd need to use variables from it instead of substitutions. See example as follows.

[code:1]
$_CB_framework->setPageTitle( 'Profile ID: ' . $user->id );
[/code:1]

and how do I keep the dot and the spaces in the words?

As far as I am aware a page title can't have periods. If the below doesn't work then not much I can advise.

[code:1]
$_CB_framework->setPageTitle( 'MyAwesomeWebsite.com' );
[/code:1]

Should I start a new thread?

No need, this thread is fine.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: energyvalley

Please Log in to join the conversation.

13 years 5 months ago #146417 by jakobe75
Replied by jakobe75 on topic Re:Profile page title
This worked PERFECT!

[code:1]$_CB_framework->setPageTitle( 'My Awesome Website.com - Profile# ' . $user->id );[/code:1]

and produces this in the browser title

My Awesome Website.com - Profile# 2071

The dot and spaces do stay in there
(however I decided to remove them in case search engine would not like)

my original version was wrong:
$_CB_framework->setPageTitle(MyAwesomeWebsite.com);

I did not have the ' around the site name.

Thanks

Post edited by: jakobe75, at: 2010/11/16 19:46
The following user(s) said Thank You: energyvalley

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.286 seconds

Facebook Twitter LinkedIn