Forums

Home » Liferay Portal » English » 2. Using Liferay » General »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Andrea Prandini
CMS and W3C validation
March 25, 2008 7:00 AM
Answer

Andrea Prandini

Rank: New Member

Posts: 22

Join Date: October 10, 2005

Recent Posts

Hi,

I'm trying to validate my portal (v. 4.3.5) pages with the W3C validator. I've seen that I can correct many errors due to my theme template. There are two errors that belongs to CMS, in particular to Journal Content Portlet.

1. The content of the article is inside a tag span. This tag doesn't permits the use of any html block tag (es: div, table, etc.). Here the code of the view.jsp.

<span class="journal-content-article"
     id="<%= articleDisplay.getGroupId() %>_<%= articleDisplay.getArticleId() %>_<%= articleDisplay.getVersion() %>">
                <%= content %>
</span>

It's possible to use a div?


2. The attribute id of the above tag starts with a digit (number). For W3C the id name must start with a letter.


Andrea
Andrea Prandini
RE: CMS and W3C validation
March 25, 2008 6:59 AM
Answer

Andrea Prandini

Rank: New Member

Posts: 22

Join Date: October 10, 2005

Recent Posts

Ok, now my homepage is W3C compliant (Quixhttp://www.quix.it).
Here my solution:

1. Changing the view.jsp of the Journal Content Portlet as I told in the previous post:

<div class="journal-content-article" id="p_<%= articleDisplay.getGroupId() %>_<%= articleDisplay.getArticleId() %>_<%= articleDisplay.getVersion() %>">
    <%= content %>
</div>


I don't know the impact of this change. I don't see any reference to that id. Maybe Liferay developers could answer.

2. Using in my portlet the API to create URL instead of tag library. We developed our portlet using <portlet:actionURL> tag to create link but this tag create URL with "&" character between parameters. This is not compliant with W3C validations. So we changed the code replacing tag library with the API renderResponse.createActionURL() and escaping the URL with the Apache Common Library


3. Changing image URL in Journal Model. If you have a structure with an image type you have to build the template escaping "&" chars in the url. Es:

<img src="$imagesmall.getData().replaceAll('&', '&amp;')" align="left"  .....


Hope this could be helpful to others that want to vaidate theiir portals.
Andrea
Wael B
RE: CMS and W3C validation
June 18, 2008 2:27 AM
Answer

Wael B

Rank: New Member

Posts: 8

Join Date: December 20, 2007

Recent Posts

Hello,

I'm novice in liferay.

Can you tell me please how can I do the second point?

In fact, all my link are with "&" and I want to change this to "&amp;":

I use site_map portlet and navigation portlet for the links.

Thank you.