gteigland VIP
Total posts: 159
22 Jul 2015 12:17

I have two sections, Projects, Portfolio. Obviously each of those have their own user home section which works good for me. However I'm wondering how I could link to the same user's page from the other home records page.

For example: http://www.awesomescreenshot.com/image/426022/e352cfb5f5142b634cf0019a97c9cb2a

As you know I've been using the code:

$userId = JFactory::getApplication()->input->getInt('user_id');

To grab the current users data or you suggested the code for link to easy profile:

<a href="/../<?php echo Foundry::user($current_user->id)->getPermalink();?>"

I'm wondering if we could do something similary but link it to the same users OTHER section home page.

Thanks!

Last Modified: 01 Oct 2015


Sergey
Total posts: 13,748
23 Jul 2015 13:22

Cobalt has different user homepage per section. But you get link to EasySocial. And this is single user homepage which can show articles from all sections. Just configure additional plugins. There are more than 10 Cobalt pl ugins in integration one per section.


gteigland VIP
Total posts: 159
23 Jul 2015 19:02

Sorry I should have explain better. WHile I am doing that with EasySocial.... IM creating an additional easier interface using just your cobalt personaliztion pages.

I don't want to go back to easysocial to see those items. I simple want to link from one section personalization page to another. In this case i want to go from User A "Project (id #1) " Section user Home page to User A "Portfolio" (id #2) Section User Home page

http://www.awesomescreenshot.com/image/430659/bf71934ece7fe0df71a53973f327f5f9

So basically I"m looking to generate the dynamic url that links it to this same user home page OF A DIFFERENT SECTION. (in this case section id #2 - portfolio)

Hope that clarifies.


Sergey
Total posts: 13,748
27 Jul 2015 05:36
$user_id = JFactory::getApplication()->input->getInt('user_id', JFactory::getUser()->get('id'));
$url = JRoute::_(Url::user('created', $user_id));

gteigland VIP
Total posts: 159
28 Jul 2015 12:02

I think the final answer would be helpful for a lot of people. Here is my scenerio: I have two sections Projects and Portfolio (I had purchase the portfolio addon which I highly recommend). As you know that would mean two user "home page" which worked good for me in my scenerio as I wanted a different look/function for both of them. On the bottom of each I have a image link to the same users home page for the other section.

In my case I created a gallery of projects and other EasySocial information and then my portfolio section is to view a slideshow of work.

Here is the dynamic code we used to link the two.

<?php 
$$userId = JFactory::getApplication()->input->getInt('user_id');            
$gallery_url = JRoute::_(Url::records(2).'&user_id='.$$userId.'&view_what=created');
?>

The number you see in the second line corrlates to the id of the section. So i just changed that to match the section i wanted it to link to

Then for the actual link we did this:

<a href="/<?=$portfolio_url?>" class="bottom-tip" data-tips="My Gallery"><img src="/../images/museum37.png"></a>

Hopefully this will be of help to others.


gteigland VIP
Total posts: 159
30 Sep 2015 17:10

So the latest update for cobalt nullified the code above.

$gallery_url = JRoute::_(Url::records(2).'&user_id='.$$userId.'&view_what=created');

I now get this error page. Can you tell me what changed in the update so this no longer works? Thanks!

http://www.awesomescreenshot.com/image/621266/e44970d5a14a38de1c688906194b8ee8

Just to note above this code worked before call in the id of the user we are viewing and then link to that users other section in cobalt.


Jeff VIP
Total posts: 745
01 Oct 2015 01:14

Have you tried

$gallery_url = JRoute::_(Url::records(2).'&user_id='.$userId.'&view_what=created');

I mean, I'm not a programmer, but is a double '$$' allowed in php?


gteigland VIP
Total posts: 159
01 Oct 2015 14:08

sorry it was typo in this thread.. so that is NOT the issue... LIke I said this code worked fine before the update...

``` $portfolio_url = JRoute::_(Url::records(2).'&user_id='.$userId.'&view_what=created');

```


gteigland VIP
Total posts: 159
01 Oct 2015 14:28

Ok so here's more info to help in this issue:

BEFORE COBALT UPDATE This code:

$portfolio_url = JRoute::_(Url::records(2).'&user_id='.$userId.'&view_what=created');

Rendered this link: WEBSITEADDRESS/index.php?option=com_cobalt&view=records&section_id=2:portfolio&Itemid=302&user_id=65&view_what=created

AFTER COBALT UPDATE THE EXACT SAME CODE ABOVE NOW RENDERS THIS LINK: WEBSITEADDRESS/index.php?Itemid=302&user_id=65&view_what=created&option=com_cobalt

And I get this error page (obviously because it's the wrong link: http://www.awesomescreenshot.com/image/624445/1541bf1ea0878e50dbc4be63938fba69

So why would the cobalt update change the rendered link?

Any ideas? Thank so much.

Powered by Cobalt