4

I have a view which has an argument passed to it. I provide a default argument of "User ID from URL". I then use %1's content in the Title. This returns username's content.

I have a content profile associated with a user. I want to get the field_first_name from the content profile and display it in the title. So I would get Lucy's content. How can this be achieved?

1 Answer 1

2

Edit your argument for configuration Add validator options for your argument by selecting PHP Code from the select box Add following code in it

 $usr = user_load(array(uid => (int)arg(2))) //Check the appropriate position of uid
 $view->display['page_2']->handler->handlers['argument']['date_argument']->options['title'] = $usr->field_first_name . "'s content";

Here page_2 is views identifier and date_argument is argument identifier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.