1. dlh
  2. Features Request
  3. Tuesday, June 25 2019, 05:07 PM
Hi,
I would like to add a "page" inside the user's page to display a php content. The page should have the same apparence as the links "Activity", "Info", "Friends", etc. AN when you are on this page, you should be still on the profile page (it shouldn't be a redirection to an other page in an other position in the website).
Thans for your help.
Kind regards,
Yann Arnould
Accepted Answer
admin Accepted Answer
Admin
Hi,
you can do this by follow these steps:
1) Create php content by creating a file called /plugins/jsn/socialnetwork/app/View/Users/ajax_page.ctp and add to this file the content
2) Create the link in left menu
- Access to Admin Panel (http://docs.easy-profile.com/index.php/article/social-network-configuration)
- Go to Theme Manager
- Choose "SocialNetwork Theme"
- Choose the file to override from left menu (Users->view.ctp)
- Click on button "Copy" and copy it in "Blue Theme" (With this you will create the override, the override will be not re-written wh en you install upgrade of the plugin)
- Come back to Theme Manager and choose "Blue Theme"
- You will see your override to customize.
- In this new file you can add something like this at line 159
<li>
<a data-url="<?php echo $this->request->base?>/users/ajax_page/<?php echo $user['User']['id']?>" rel="profile-content" href="#"><i class="icon-file-text-alt"></i> <?php echo __('New Page')?></a>
</li>

3) Create controller function
in file at /plugins/jsn/socialnetwork/app/Controller/UsersController.php you should add a function like this (for example at line 14):
public function ajax_page( $uid = null )
{

}


NOTE: changes at steps 1 and 2 will be not overridden after upgrade, but unfortunately in future when you upgrade Social Network plugin then you need to re-apply step 3
  1. more than a month ago
  2. Features Request
  3. # Permalink


There are no replies made for this post yet.
However, you are not allowed to reply to this post.