odove
Customers
Post Count:114
 |
|
Will Morgenweck
Forum Admin
DotNetNuke Staff
Post Count:7672
 |
| 11 May 2010 01:31 PM |
|
You could take another approach which could be implemented right now. There is a template called MiniProfile. That is rendered using the ClientAPI. We will see if the forums let me post this code...
<script type="text/javascript" src="YOURPATH?uid=[USERID]"></script>
|
|
Will Morgenweck
Director of Product Management
DotNetNuke Corp.
|
|
|
Will Morgenweck
Forum Admin
DotNetNuke Staff
Post Count:7672
 |
| 11 May 2010 01:33 PM |
|
You would replace "YOURPATH" with something like this... /desktopmodules/activesocial/handlers/profile.ashx |
|
Will Morgenweck
Director of Product Management
DotNetNuke Corp.
|
|
|
odove
Customers
Post Count:114
 |
| 11 May 2010 01:57 PM |
|
Thank you for getting back. Sorry I am a bit slow on this. Can you please add a few more words on how to do it? Where should I add the javascript? Thanks. |
|
|
|
|
Will Morgenweck
Forum Admin
DotNetNuke Staff
Post Count:7672
 |
| 11 May 2010 02:05 PM |
|
I think you were trying to update a template in a third-party module that supports tokens, correct? The same place you were going to need a token for VanityName, just use the script I provided above. That will automatically render an HTML template based based upon the USERID. You will need to modify the HTML template to meet your needs, but an example is already provided using the MiniProfile template from the Profile folder. |
|
Will Morgenweck
Director of Product Management
DotNetNuke Corp.
|
|
|
odove
Customers
Post Count:114
 |
| 11 May 2010 06:37 PM |
|
Thank you for the further instruction. I just can not get it 100%. What I need is from Ventrian's NA and PA I can have a link created for any user that points to their AS profile page. It's easy if I don't use vanity urls so it would look like this: http://www.mysite.com/Community/MyP...].aspx But when using vanity urls, I need a link like this: http://www.mysite.com/[DISPLAYNAME], since that's the profile page looks like. Even this one works ok if there is NO space in the display name. I checked the miniprofile control and I could not understand how that relates to the issue. I also tried the code you provided and came up with something like this but didn't work ( and I know I didn't get it ): http://www.mysite.com/<s.../> |
|
|
|
|
Will Morgenweck
Forum Admin
DotNetNuke Staff
Post Count:7672
 |
| 11 May 2010 06:47 PM |
|
You would use our profile instead of any of the ventrian profile tokens. I'll see if I can come up with a better example. |
|
Will Morgenweck
Director of Product Management
DotNetNuke Corp.
|
|
|
odove
Customers
Post Count:114
 |
| 11 May 2010 07:52 PM |
|
I tried more. It looks like I can not make it happen without some more help. Thanks... |
|
|
|
|
Ray Dixon
Customers
Post Count:199
 |
| 12 May 2010 02:02 PM |
|
I have Ventrian NA set up on our site so that it displays the author's photo and display name and they link to the user's profile. Below is a snippet from our view.item template.
article posted on [PUBLISHSTARTDATE:dddd, MMMM dd, yyyy] at [PUBLISHSTARTDATE:t] by [ISNOTANONYMOUS]<a href="/profile.aspx?asuid=[AUTHORID]" title="Click to view the profile for [AUTHOR]">[/ISNOTANONYMOUS]<img border="0" src="/desktopmodules/activesocial/profilepic.ashx?PortalId=0&uid=[AUTHORID]&h=25&w=25"/> [AUTHOR][ISNOTANONYMOUS]</a>[/ISNOTANONYMOUS] We have our profile view page set up so only logged in users can view it, which is why you see the ISNOTANYNYMOUS tokens for the links. Here is a simplified version of the code above that you could use if you want to enable the link to the profile for all users (including unauthenticated users):
article posted on [PUBLISHSTARTDATE:dddd, MMMM dd, yyyy] at [PUBLISHSTARTDATE:t] by <a href="/profile.aspx?asuid=[AUTHORID]" title="Click to view the profile for [AUTHOR]"><img border="0" src="/desktopmodules/activesocial/profilepic.ashx?PortalId=0&uid=[AUTHORID]&h=25&w=25"/> [AUTHOR]</a> Our profile view page is profile.aspx and is a root page of the portal. You will have to update that part of the template with the path to the page you are using to view profiles. Other than that, this should work for you, unless Active Social is installed somewhere other than in the desktopmodules folder. This doesn't answer the specific question about how to use the MiniProfile with the ClientAPI, mainly because I don't fully understand it, yet, and I haven't had time to try it out in NA. However, I can tell you that we are using this technique for both the author and the user who last updated the article in NA as well as for the agents in PA. |
|
|
|
|
odove
Customers
Post Count:114
 |
| 12 May 2010 04:49 PM |
|
Thanks for the post Ray! Are you using the vanity urls for the profile page?
|
|
|
|
|
Ray Dixon
Customers
Post Count:199
 |
| 13 May 2010 01:12 AM |
|
We do not have the vanity URLs enabled, so we're just using the profile page. I don't know if simply passing the asuid to a profile page will work with vanity URLs enabled. |
|
|
|
|
odove
Customers
Post Count:114
 |
| 14 May 2010 12:19 AM |
|
I don't know if simply passing the asuid to a profile page will work with vanity URLs enabled. I tried and it didn't work. Thank you for the help. Hope Will can explain more... If I still can not get it to work soon I might have to forget about this vanity urls thing and move on. |
|
|
|
|
Jeff Blanks
Customers
Post Count:387
 |
| 15 Jan 2011 11:52 AM |
|
Posted By Will Morgenweck on 11 May 2010 02:31 PM
You could take another approach which could be implemented right now. There is a template called MiniProfile. That is rendered using the ClientAPI. We will see if the forums let me post this code...
<script type="text/javascript" src="YOURPATH?uid=[USERID]"></script>
I can get the script to run without error, and it properly resolves urls and displays all code from miniprofile.ascx in the page source, but it won't display for some reason. I'm guessing maybe because it's wrapped with the script tag? I also tried the Profile Display Control http://www.activemodules.com/Commun...fault.aspx and registered the control (Ventrian PA) in my viewproperty.ascx, and also tried in my templates without success. Anyone else get vanity urls working yet for PA or other 3rd party modules that utilize html templates? |
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|
Jeff Blanks
Customers
Post Count:387
 |
| 24 Feb 2011 09:25 PM |
|
Ok, I got the code to actually work and display on the page. Granted this is not the most ideal solution but it will display vanity url's in 3rd party modules. I'm still looking for other solutions.
<iframe src="/desktopmodules/activesocial/handlers/profile.ashx?uid=[USERID]" width="300" height="300"></iframe>
|
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|
Jeff Blanks
Customers
Post Count:387
 |
| 24 Feb 2011 10:25 PM |
|
Ok, I've got an even better option for this with the aid of a little jQuery. Much cleaner and properly loads up any classes you are using in your templates. The iframe strips out all formatting unless it's inline rather than in a css file.
<div id="WhateverYouWant"></div>
<script>
$("#WhateverYouWant").load("/desktopmodules/activesocial/handlers/profile.ashx?uid=[USERID]");
</script>
Depending on the module you are using, you may have to change [USERID] to something else. The call to profile.ashx is loading this template file: config > templates > profile > miniprofile.ascx. It won't pickup any other filename or any other file location. Or at least with my testing, I've found that it won't. So far, with the exception of having to rely on jQuery to display the template, the only other downfall is being limited to that one file for templating. Hope this helps others to further expose vanity urls in other modules. I've been banging my head on this one for a very very long time. I only use FUP, and I'm sure there is a solution through URL Master, but I wanted to keep it much simpler and easily adaptible. |
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|
Jeff Blanks
Customers
Post Count:387
 |
| 26 Feb 2011 04:19 PM |
|
Was doing some more testing on this. Rather than using an id, it would be better to define a class so that duplicate id's aren't created. It's also better to define jQuery:
<li class="vName"></li>
<script>
jQuery(".vName").load("/desktopmodules/activesocial/handlers/profile.ashx?uid=[USERID]");
</script> |
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|
Jeff Blanks
Customers
Post Count:387
 |
| 09 Mar 2011 06:08 PM |
|
Here's another solution that can be used in your skins. This way you don't have to add to module templates and rely on the module userid token:
<div class="WhateverYouWant"></div>
<script>
jQuery(".WhateverYouWant").load("/desktopmodules/activesocial/handlers/profile.ashx?uid=<%=UserController.GetCurrentUserInfo().UserID %>");
</script> |
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|
Jeff Blanks
Customers
Post Count:387
 |
| 09 Mar 2011 09:27 PM |
|
Well, Forget all this! After my final testing, I found out it's only resolving to the user that's logged in. This option can still be used but it will have to be loaded in templates, and you can only use it once on a page without it loading the logged in user's vanity name. Example: If using on a page and you want to show a listing along with the user info, it will work. But will not work for things such as comments on a page since it gets loaded multiple times. Vanity names have been driving me nuts since day ONE! The way I understand it is, vanity names can only be used within modules using ascx templates. Guess I'll have to break down and lose some link juice with multiple urls to a user, or upgrade from FUP to UM. I do have a PB rule that works pretty well, but will not resolve a vanity url when there are multiple users with same firstname lastname. Ex: AS writes the first user as: John-Doe And subsequent users: John-Doe2 For ascx templates: http://www.activemodules.com/Commun...fault.aspx And other discussions on this: http://www.activemodules.com/active...r-modules/ http://www.activemodules.com/active...real-name/ http://www.activemodules.com/active...nity-urls/ |
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|
Will Morgenweck
Forum Admin
DotNetNuke Staff
Post Count:7672
 |
| 09 Mar 2011 09:32 PM |
|
Jeff, I will add some code to AS 2.0 so this isn't that difficult. |
|
Will Morgenweck
Director of Product Management
DotNetNuke Corp.
|
|
|
Jeff Blanks
Customers
Post Count:387
 |
|
Jeff Blanks
Customers
Post Count:387
 |
| 18 Jun 2011 12:39 PM |
|
Posted By Will Morgenweck on 09 Mar 2011 10:32 PM
Jeff, I will add some code to AS 2.0 so this isn't that difficult.
Just hoping to see an easy solution for vanity names to be used in html templates still make it into 2.0. |
|
Cheers! Jeff
@northeastok | @jeffblanks | My Blog |
|
|