Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Articlelist like CategoryList Webpart View modes: 
User avatar
Member
Member
alexo - 5/17/2011 8:59:59 AM
   
Articlelist like CategoryList Webpart
Hi everyone,

as the forum members give always great advice for my problems - i am back again ;)

i want to display a list of articles and if a single article is selected only this one should be displayed. Also the list should be available and the current article be highlighted (like a navigation).

i thought about using the articlelist like a categorylist and transfer the ID to the repeater Webpart.

Is there a possabilty to use an article list with repeater like categoryList (categoryID -> repeater) so that i can display only the selected article but the list is still available?

or is there an other solution which i can't figure out at the moment?


thx for help

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 5/24/2011 7:59:55 AM
   
RE:Articlelist like CategoryList Webpart
Hello,

You can achieve your goal easily by using 2 Article list webparts on the same page template (well, there can be used also the Repeater webparts, it is equal). Now, one of them will list all the articles (#1) whereas the another one (#2) will show just the selected article (using a selected item transformation).

Please note, there needs to be define NO selected item transformation in the #1. This way, it will always show the pure article list. Moreover, in order to achieve the navigation effect, you need to insert some decision statement to the transformation to recognize the actual document which is supposed to be highlighted. This means, you can create either a custom function to transformation and do it in code or you can use expression as follows directly in the transformation:

<%# IfCompare(Eval("NodeGUID").ToString(), CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("{%cmscontext.currentdocument.nodeguid%}"), "normal link", "highlighted link") %>


Let's take a look at the settings of the #2. Please set the Show for document types property to your article document type. This will enforce it will be used exclusively on the article detail. Please also define the Selected item transformation for it as it is necessary for the article list detail.

Using this approach, you'll develop a SEO friendly solution, since all the articles will have their document name in the URL.

User avatar
Member
Member
alexo - 5/26/2011 10:07:12 AM
   
RE:Articlelist like CategoryList Webpart
hi!

Thank you very much - it worked perfectly. I just left the "Show" setting empty, because it didn't show my overview...

My trial was also quite good i unfortunately didn't know the expression for the current document and i didn't leave the "selected item transformation" field empty. so, thx a lot for your advice!


Anyway, i have one more question:

is there a easy solution for a "All"-Item? At the moment i use the html-envelop to insert a list item manually (also in my category-lists)...



thanks,

alex


User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 5/31/2011 4:20:30 AM
   
RE:Articlelist like CategoryList Webpart
Hello,

I'm glad that my solution helped. Anyway, as for your second question, I'm not sure that I got the point. Could you please specify it further?

Basically, the more details the better :-)

Best regards
Ondrej Vasil

User avatar
Member
Member
alexo - 5/31/2011 6:44:06 AM
   
RE:Articlelist like CategoryList Webpart
Hi,

as i mentioned in my first thread, i want to 'simulate' a navigation, in this case i need an item "all" which is defined as current by default like this:


my article list as 'navigation':

'all-articles' ---- article1 ---article2----article3 etc.


if i click 'all-articles' all articles should be displayed, if i click article1 - only article1 should be displayed (the solution you told me...)


i have the same problem with my categorylists:


'all categories' ----cat1-----cat2----cat3 etc.



i hope i explained it more clearly now.


thx, alex



User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/2/2011 5:49:56 AM
   
RE:Articlelist like CategoryList Webpart
Hello,

If I got it right, you just need to either add the link for the current document which lists all the articles to the content before property of the "navigation" article list. The other option is using another Repeater web part to show just the current document.

Please also remove the CMS.Article value from the Show for document types property of the second "listing" Article list web part.

Hope this makes sense. You could also take advantage of our consulting services where we could take a look at it directly on your site.

Best regards
Ondrej Vasil