[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

aMember page title

Posted on 2014-02-27
1
Medium Priority
?
453 Views
Last Modified: 2014-02-28
I've submitted a support ticket at aMember for this, but it's taking too long to get resolved. They don't seem to understand what we need so I'm hoping someone here is familiar with aMember and might be able to help quicker.

Our aMember installation is using the wordpress plugin so that it uses the wordpress theme. So I have to use the wp_title hook in the amember site.php file that's used for custom funcitons to work with the page title. The problem I'm having is that we want the member's custom profile field of company name to show in the page title according to the member profile being viewed by anyone. This way when the search engines list the pages, they will have the site and the company name showing.

This is the code that actually hooks and alters the page title - which does work, BUT it ONLY shows the company name of the user logged in and only when logged in. What we need is the company name to show regardless of being logged in and the company name of the profile being viewed.

//for page titles
function amember_wp_title( $title, $sep ) {
	global $paged, $page;
	if($user = Am_Di::getInstance()->auth->getUser())
	     $cname = $user->company_name; 
	$title = get_bloginfo( 'name' ).' | Member | '. @$cname;
	return $title;
}
Am_Di::getInstance()->hook->add(Am_Event::GLOBAL_INCLUDES_FINISHED, 'myglobalIncludesFinished');
function myglobalIncludesFinished()
{
add_action("wp_head", 'wpHeadHook');
add_filter( 'wp_title', 'amember_wp_title', 20, 2 );
}

Open in new window


Here's some pages to view to get a better understanding of what I mean:

This page should add Search Commander, Inc. to the title:
http://www.sempdx.org/amember/directory/index/666363524144

This page should add Thomas Creek Concepts:
http://www.sempdx.org/amember/directory/index/414e46633634

Any help would be great. Even if there's other suggestions besides the amember's code calls might be worth trying.
0
Comment
Question by:Dzynit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
Dzynit earned 0 total points
ID: 39895130
I thought it might be difficult to get an answer on this since I didn't find many amember questioned asked here.
Support finally got the right code combo, so it's now working. For anyone that might search for help with this:

    $request = Zend_Controller_Front::getInstance()->getRequest();
    if($request->getModuleName() == 'directory' && $request->getParam('user_id')){
        $rec = new DirectoryRecord(Am_Di::getInstance()->directoryTable);
        $user_id = $rec->decodeUserId($request->getParam('user_id'));
        $user  = Am_Di::getInstance()->userTable->load($user_id);
// $user - is Object of user which profile is  being displayed at the moment. 

    }

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question