9 years ago
Topic

Hello,

I have two problems about Seblod and Community Builder integration :

First, with the "Article Created by" item, I would like to create a direct link to the CB profile.

I have the author id but the link is index.php/article/articlename<ID>

and not /index.php/cb-profile/userprofile/<ID>

How I can have the correct link ?


Second, It's possible to get the image profil of the user ? If yes, how ?

I have the latest version. 


Thank you very much.

Bests,

Arnaud



Get a VIP membership
233 Posts
pepperstreet
9 years ago
1
Level 1

Hello Arnaud,

to get the author's CB profile link you can use a typography option on your field... in short:

1.) Add field Article Created By to your list/item view.

2.) Click #2 to get the link/typography column.

3.) For the Article Created By field, set typography from NONE to HTML.

4.) Click the small plus icon next to it. (+)

5.) Enter the necessary HTML link markup and add the special field placeholder *value* and *text* to it. See example below:

	<a href="/component/comprofiler/?view=userprofile&user=*value*&Itemid=999">*text*</a>

PS: The Itemid 999 is just a placeholder... it could be anything you see fit. Most likely the same Itemid like your mandatory CB Profile MenuItem has.

  

----

  

To get the Avatar image thumbnail is not so easy and clear. At least with free and build-in features... 
 

Basically you could go a similar route as with the profile link, but it is more than one step to build the correct link. CB stores the pure image name in the database. The name is a random number pre-fixed with the UserID# and underscore. There is no path. Hence, some users might not have an image, then the value is NULL. Also images might not be approved. These conditions result into a different default image and path.

  

Anyways, some further thoughts and options to get the proper infos:

  

a.) CB PRO -> CONTENT BOT plugin would be perfect and easy. Benefit: no coding, just a CB plugin and entering substitution syntax.
Unfortunately, I noticed that it does not work on Seblod List views! Although other Content plugins do work, so it might be a bug on one or the other side...

  

b.) Querying the database is not enough. You would have to store the image name... then you can retrieve that field and build the simple link with CB's default image folder path. Should work, until you have NO image. Maybe this can be checked in Seblod with a conditional: If NULL then display default avatar or placeholder?! 

  

c.) CB provides an API, but this requires to use PHP/code. Benefit: No extra queries.

 

PS: Commercial products/addons might also help  i.e. Code Pack, SQL field etc.

 

9 years ago
0
Level 2

Thank you !

Get a Book for SEBLOD