Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Displaying Data from a different site using the same database. View modes: 
User avatar
Member
Member
hmoser-bostwicklaboratories - 10/21/2009 1:02:32 PM
   
Displaying Data from a different site using the same database.
I am using the repeater to display the staff on our website, we have multiple websites with the same staff and instead of having a document for each staff member on each website I would like to use the 'site name' option in the repeater. When I use this option all of the data is called except for the staff photo. and when I click on the name to diplay the full bio I get a message that the page cannot be displayed. I am using the following transformation:

<a href="<%# GetDocumentUrl() %>"><%# IfEmpty(Eval("StaffPhoto"), "", "<img src=\"" + GetFileUrl("StaffPhoto") + "?height=110\" alt=\"Photo\" />") %><%# Eval("DocumentHeader") %></span></a><%# MyFunctions.TrimText(Eval("StaffBio"), 200) %><a class="OvalButton" href="<%# GetDocumentUrl() %>">Read More</a>

FYi: the websites use the same database, but each website is running in its own directory.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/22/2009 6:14:05 AM
   
RE:Displaying Data from a different site using the same database.
Hello,

Could you please answer me some questions?

1. Please check the event log (Site manager -> Administration -> Event log). Are there any related information?

2. If you see the rendered code what is the href of <a> tag?

3. If you copy the URL from href and try to display it what do you see?

4. Is the document (the full bio) secured in some way? (e.g. not to display for unauthenticated users)

5. Is it the document from the different site?

Thank you in advance.

Best regards,
Helena Grulichova

User avatar
Member
Member
hmoser-bostwicklaboratories - 10/22/2009 8:25:52 AM
   
RE:Displaying Data from a different site using the same database.
1. Please check the event log (Site manager -> Administration -> Event log). Are there any related information?
I did not see anything.

2. If you see the rendered code what is the href of <a> tag?
<a href="/GLOBAL/Company/Senior-Leadership/Medical-Director-Molecular-Diagnostics.aspx"><img src="/GLOBAL/getattachment/b7893b0a-f6af-4d0b-a908-a4fcf9753f70/Medical-Director-Molecular-Diagnostics.aspx?height=110" alt="Photo" /></>

3. If you copy the URL from href and try to display it what do you see?
If I include the origination domain www.gynecor.com, nothing. If I include the www.bostwicklaboratories.com it works fine.

4. Is the document (the full bio) secured in some way? (e.g. not to display for unauthenticated users)
It is only set-up under an ssl, but anyone should be allowed to view it.

5. Is it the document from the different site?
The document is from a differnt site on the same server and the same database.

Should I reference the www.bostwicklaboratories.com in the transformation for this to work, or is there a better solution? We have 8 websites and some of the staff members are exactly the same, so I am trying to limit the amount of duplicate work, especially when a bio or a staff member needs to be removed. Thanks again for your time. You have been very patient with my questions.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/27/2009 6:56:04 AM
   
RE:Displaying Data from a different site using the same database.
Hello,

thank you for your answers.

There is a transformation function for documents from different site: <%# GetUrl("/News/News-1", null, "CorporateSite") %> but not for attachments.

1. You could hard-code the domain name in the src attribute or
2. develop a custom function which would return the correct full URL. More information about transformation function developing is here: http://devnet.kentico.com/docs/devguide/adding_custom_functions_to_transformations.htm

Best regards,
Helena Grulichova