Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > What webpart should I be using to display extended document data? View modes: 
User avatar
Member
Member
vcarter - 7/30/2013 12:24:33 PM
   
What webpart should I be using to display extended document data?
I have a document type called Fact Sheet. It contains many columns of relevant data. I would like to create a listing page(similar to news) that has links to detailed views of each fact sheet.

Fact sheets can have one to many relationships with Regions and Business Units so I decided to use a custom query to retrieve the list. This aspect worked out well and I am able to get a list of fact sheets formatted as needed.

I have also created a Fact Sheet Detail page, which contains a UniView Web Part and accepts a query string of fsid to display a detailed view.

My problem, how do I link the two. Since my listing page uses a UniView with a custom query and is not using the "Path" attribute I find myself unable to create a proper path from my list page to my detail page.

I have gone down several paths(and made several posts) trying to figure out the best way to accomplish my goal and now I am just about at my wits end.

Am I going about this all wrong? I had some concerns with nesting repeaters so I abandoned that idea in lieu of using a custom query. How do I append the path of the page that my list view is on to the links to my detail pages? Is that even possible.

My transformation code is as follows:


<%if (Convert.ToInt32(Eval("ShowCountry")) == 1) { %>
<tr><td colspan="5"><h2><%# Eval("Country") %></h2></td></tr>
<tr>
<th><h3>State/Province</h3></th>
<th class="city"><h3>City</h3></th>
<th class="businessunits"><h3>Business Units</h3></th>
<th class="map"><h3>Map</h3></th>
<th class="factsheet"><h3>Fact Sheet</h3></th>
</tr>
<tr>
<td><%# Eval("StateProvince") %></td>
<td><%# Eval("City") %></td>
<td><%# Eval("BusinessUnit") %></td>
<td><a href="" target="_blank"><img alt="" src="~/[Image]" style="border-width: 0px; border-style: solid;" /></a></td>
<td><a href="[WHAT GOES HERE]Facility-Fact-Sheet.aspx?fsid=<%# Eval("FactSheetID") %>" target="_blank"><img alt="" height="20" src="~/[Image]" style="border-width: 0px; border-style: solid;" width="20" /></a></td>
</tr>
<%} %>
<%else { %>
<tr>
<td><%# Eval("StateProvince") %></td>
<td><%# Eval("City") %></td>
<td><%# Eval("BusinessUnit") %></td>
<td><a href="" target="_blank"><img alt="" src="~/[Image]" style="border-width: 0px; border-style: solid;" /></a></td>
<td><a href="[WHAT GOES HERE]Facility-Fact-Sheet.aspx?fsid=<%# Eval("FactSheetID") %>" target="_blank"><img alt="" height="20" src="~/[Image]" style="border-width: 0px; border-style: solid;" width="20" /></a></td>
</tr>
<%} %>


I am stuck and could really use some advice. I am open to all suggestions. Should I have just tried to implement nested repeaters for Business Units and Regions? If so where do I put that code as the documentation references a SOURCE tab that I am not seeing as an attribute of my web parts.


User avatar
Member
Member
kentico_sandroj - 7/30/2013 1:10:55 PM
   
RE:What webpart should I be using to display extended document data?
Hello,

Depending on where/how the FactSheet documents are stored, you may be able to use the GetDocument methods to get the URL.

If the desired structure already exists in the content tree, the best approach would be using the Hierarchical Viewer both for performance and ease-of-use. Would you mind giving us a bit more detail on the structure of these documents?

User avatar
Member
Member
vcarter - 7/30/2013 3:16:16 PM
   
RE:What webpart should I be using to display extended document data?
I apologize in advance for the redundant post, pretty sure FroggEye has seen this before and I blame my inexperience for not being able to convey my issue properly.

Anyway.

As I said, Fact Sheets are a standard document type, very similar to a news document. Neither of which acts as a page(they are basically data containers as far as my understanding goes and do not have templates directly associated with them).

Like a news item, they reside below a listing page in the CMS content tree.

North America (type Page(Menu Item))
- Fact Sheet 1
- Fact Sheet 2
- Fact Sheet 3

Business Units are custom table data, just a name and an ID

Widget Maker (ID 1)

On my Fact Sheet Form, I have a multi-select field that allows many business units to be associated with a particular fact sheet document. Which is stored as a list of Business Units in the database record for a given fact sheet as a pipe delimited list(The Kentico standard for multi selects)

On my list page for Fact sheets I need to display the corresponding business unit names, along with some basic fact sheet data:

State/Province City Business Units Map Link Fact Sheet Detail
--------------------------------------------------------------------------------------------------
OH Cleveland Unit1, Unit2 Link to Map Link to Detail

Rather than use a nested repeater to display the list of units, I created a custom query that pulls back the fact sheet document data and is joined with the business unit table replacing the pipe delimited list with a list of business unit names, pushing the work of gathering all of the peripheral information onto the database as opposed to having this done via a repeater(which would do a query anyway).

My problem is figuring out a way to link my detail pages to my list. Normally this would be a simple matter of setting the path attribute as well as a list transformation along with a selected item transformation. However since I am using a custom query to get my list, the selected item aspect does not work. So how do I link the two?

None of the standard node information seems to be available to me, and I am not sure what I am doing wrong. Putting GetDocumentUrl() in my code does not generate the link properly so I am unable to construct my path to the detail page.

At this point all I need is for my transformation to be able to know the node path for the parent page, in this case North America. So my link would hopefully look something like this:


<a href="/Comapany-Info/North-America/Facility-Fact-Sheet.aspx?fsid=<%# Eval("FactSheetID") %>" target="_blank">Fact Sheet</a>


Facility-Fact-Sheet.aspx refers to a generic details page I created that has a UniversalViewer on it and accepts the queryString variable fsid.

I would prefer to just use a selected item transformation, but my understanding is that this does not work without using the Path attribute of the webpart.

I have been avoiding writing custom controls or code due to not having direct access to my clients file system. Is what I am attempting possible purely through CMS desk and the portal engine? Or do I need to be able to create a cloned webPart that allows for the details page info to be set programatically.

Does any of that make sense?

User avatar
Member
Member
kentico_sandroj - 7/30/2013 3:47:59 PM
   
RE:What webpart should I be using to display extended document data?
Thank you for the clarification, it does make more sense now. So you mentioned that at this point you need the URL of the parent for the current document in the transformation, correct? If so, since the Fact documents exist in the content tree, you can get their parent node url like this:

<%# CMS.CMSHelper.TreeHelper.SelectSingleNode(CMS.GlobalHelper.ValidationHelper.GetInteger(Eval("NodeParentID"),0)).NodeAliasPath %>


If this doesn't work for you, a custom function may be required, in which case you would need access to the file system. I will also check if the developers or consultants have any suggestions.

User avatar
Member
Member
vcarter - 7/30/2013 5:38:08 PM
   
RE:What webpart should I be using to display extended document data?
That did the trick. Thank you very much!

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/30/2013 8:19:48 PM
   
RE:What webpart should I be using to display extended document data?
Couldn't you also use the macro
{% CMSContext.CurrentDocument.Parent.NodeAliasPath @%}