DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Creating an Article List With IBM WCM 8.0 (Part 5)

Creating an Article List With IBM WCM 8.0 (Part 5)

In the last part of the five-part series, we’re going to add the article list to Portal through the use of Portal managed pages and Web Content Viewer portlets.

Roan Bester user avatar by
Roan Bester
·
Jun. 30, 16 · Web Dev Zone · Tutorial
Like (2)
Save
Tweet
2.59K Views

Join the DZone community and get the full member experience.

Join For Free

In the last part of the five-part series, we’re going to add the article list to Portal through the use of Portal managed pages and Web Content Viewer portlets.

To show the article list, we’re going to create a Portal page, set a layout for the page, add a Web Content Viewer portlet and configure the portlet to render both the article list as well as broadcast link clicks to the detail page.

We also need a child page that will render out the detail article.

Step 1: Create the Pages

Note

For the purpose of this article, I’m assuming you know how to create a Portal Managed Page, have an appropriate page layout available in your theme and know how to search for and add a Web Content Viewer (JSR286) portlet to a slot on the page.

Create a page, “articles”, with a unique ID (e.g. com.mysite.articles), set the layout to an appropriate one (I have one with a single-column bootstrap grid) and add a Web Content Viewer (JSR286) portlet.

As a child of the “articles” page, create a page called “article-detail” and give it a unique ID like “com.mysite.articles.detail”. Add a Web Content viewer (JSR286) portlet to this page as well.

You should now have two managed pages:

com.mysite.articles (Page name and friendly name "articles")

-> com.mysite.articles.detail (Page name and friendly name "article-detail")

Step 2: Configure the "list view" Web Content Viewer Portlet

Edit the page layout for the "articles" (parent) page and open up the “Edit shared settings” menu on the Web Content Viewer portlet (JSR286).

Under the “Content” section of the popup dialog, set the following:

  1. Content Type -> “Content item”

  2. Content behaviour -> “Select content and path”

  3. Content -> the Content Item you created that has the Menu Component on it. 

  4. Alternate presentation template -> None, as the content item’s authoring template already specified a default presentation template.

Under the Advanced Options section:

  1.  Set “Broadcast links to” to be “The following Portal page”. Set the value in the input box to the page unique ID of the article detail page we created.

  2.  Leave the rest as-is.

Save and close.

Below are some screenshots you can use to compare your results.

web content viewer - article list part 1

Image title

Step 3: Configure the "article detail" Web Content Viewer Portlet

Go to the article detail page (child page of the article list page) and open up the Web Content Viewer portlet’s “Edit shared settings” menu.

Set the Content Type to “Content Item”. Content behaviour to “Select content and path” and choose the “Articles” site area where our article content items are kept as the “Content”.

If required, set the Alternate Presentation template to the Article presentation template. There seems to sometimes be an issue when you point the WCM viewer to a site area instead of a content item and you don't pick an alternate presentation template.

Leave the rest as-is.

Save and close.

Note

Due to this page being the target of another WCM page, the page context is set to the source content item. What this means is that, if you have a WCM viewer that need to render a content item other than the one from the context provided by the URL, you’ll need to tell that viewer to ignore links received from other portlets or pages. This can be done under the Advanced Options section in the Web Content Viewer’s Edit shared settings menu/form.


Summary

In this section, we’ve mapped the WCM content to our Portal Pages using the Web Content Viewer portlet and page layouts. You should be seeing it working in Portal.

Congratulations, you now have a working article list!

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Smarter Redis
  • Java: Why Core-to-Core Latency Matters
  • Upsert in SQL: What Is an Upsert, and When Should You Use One?
  • Modern REST API Design Principles and Rules

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo