Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Theme for CMS with Automated Page Generation Fuad Efendi November 9, 2007 9:44 AM
RE: Theme for CMS with Automated Page Generation Fuad Efendi November 10, 2007 7:13 AM
RE: Theme for CMS with Automated Page Generation Fuad Efendi November 10, 2007 3:27 PM
RE: Theme for CMS with Automated Page Generation Not Me June 12, 2008 8:02 AM
Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS with Au Ray Augé June 12, 2008 8:15 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Not Me June 12, 2008 9:29 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Not Me June 12, 2008 1:51 PM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Not Me June 13, 2008 4:49 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Ray Augé June 13, 2008 6:18 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Not Me June 13, 2008 7:13 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Not Me June 17, 2008 5:58 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Milan Jaroš April 10, 2009 1:28 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit Tony Lim July 31, 2009 10:23 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit David García González March 2, 2011 4:17 AM
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit David García González March 2, 2011 4:33 AM
Fuad Efendi
Theme for CMS with Automated Page Generation
November 9, 2007 9:44 AM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 153

Join Date: April 5, 2007

Recent Posts

Hi,
I want to develop theme which can check 'links' and generate 'pages' with 'portlet' (if they don't exist yet) accordingly to settings in displayed Journal Article.
Which API do I need? Which Velocity variables?

I have few hundreds of 'expandable' Journal Articles, and I'll need to implement 'expandability via JavaScript/DOM (not acceptable due to SEO and UA), or (this is better) to have the ability of several templates attached to journal article.

When user clicks on Journal Article link, new page should be generated, with friendly URL etc., showing more details. Making this as a portlet is not possible... again, SEO. I need URL to a page.

Any advice guys!

Thanks
Fuad Efendi
RE: Theme for CMS with Automated Page Generation
November 10, 2007 7:13 AM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 153

Join Date: April 5, 2007

Recent Posts

I think I should go different way, using Velocity and code snippet from liferay-noir-theme:

#if ($journalArticleLocalService.hasArticle($group_id, $journalArticleId))
$velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")
$velocityPortletPreferences.setValue("group-id", "$group_id")
$velocityPortletPreferences.setValue("article-id", $journalArticleId)

$theme.runtime("56_INSTANCE_a453", "", $velocityPortletPreferences.toString())

$velocityPortletPreferences.reset()
#end



I can pass journalArticleId as a request parameter, and using UrlRewriteFilter I can have friendly URLs too.


Next question: how to assign different Journal Template at runtime?
Fuad Efendi
RE: Theme for CMS with Automated Page Generation
November 10, 2007 3:27 PM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 153

Join Date: April 5, 2007

Recent Posts

It does not work, and I reopened LEP-3458.

Even if it works... temporary workaround in RuntimeTag.java:
if (Validator.isNotNull(defaultPreferences)) {
PortletPreferences prefs = PortletPreferencesFactoryUtil.getPortletSetup(
req, portletId, true, true, defaultPreferences);

prefs.setValue("article-id", defaultPreferences);

prefs.store();


}


- pass $articleId instead of $velocityPortletPreferences.toString().


Even if it works, it is not 'thread-safe', it changes PortletPreferences for current Request:
?articleId=99999


When we call $theme.runtime("JOURNAL_CONTENT_$journalArticleId", "", $velocityPortletPreferences.toString())

with non-existing PortletPreferences "JOURNAL_CONTENT_$journalArticleId" - it will be created! But it won't be added to Layout.

It seems that I can't use such technics for the task...

Another possible solution:
com.liferay.portal.servlet.FriendlyURLServlet

- here I can put a code which will create non-existing Layout with PortletPreferences etc...


P.S.
I have a business requirements: when new article is added, Asset Publisher should 'publish' a link to a new article page.
Not Me
RE: Theme for CMS with Automated Page Generation
June 12, 2008 8:02 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Fuad,

We are planning on a migration to Liferay and would like to have this feature also.

We are trying to have a list of headline news in the home screen and once you click on a piece of news it should show the complete news/story and obviously with the metadata information stored (description and keywords).

Did you find a way to do it? I think that your idea of creating another theme for the Journal content is a good workarround...

My fast solution was deploying the Message Board, but unfortunately it does not fill the metadata information...

Any help will be greatly appreciated!

Thanks,
Mariano.
Ray Augé
Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS with Au
June 12, 2008 8:15 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

> We are trying to have a list of headline news in the home screen and
> once you click on a piece of news it should show the complete
> news/story and obviously with the metadata information stored
> (description and keywords).
>


We already support this in two different ways...

a) using Asset Publisher (less customizable, more point and click)
b) using dynamin Journal Templates which list/generate links to Journal
Content portlet specifying the Friendly URL (more customizable, less
point and click, see the Wiki)

HTH!
Not Me
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
June 12, 2008 9:29 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Ray Augé:

We already support this in two different ways...


Glad to here that!

I have so many things to check in order to migrate that I missed that...

I'll look for it and keep you posted!

Thanks for the fast response! It is really appreciated!

Mariano.
Not Me
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
June 12, 2008 1:51 PM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Ray,

I'm afraid that none of them allows metadata information such as keywords and page description, right?
The asset also does not change the page title.

Do you know any way to change the page description and keywords according to the published content?

I've already searched on the forum, but didn't find anything related...

Thanks in advance!
Mariano.
Not Me
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
June 13, 2008 4:49 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi again!

Well... Below is what I tried with no luck. Please, let me know if you found a solution...

First of all, I tried with the easy way... The Asset publisher. It does not allow to change the title and it was not what expected when I wanted to see the abstract list...

Then, I tried with the Journal Template.

I followed the wiki tutorial, but as the portlet is shown in the middle of the page, the browser doesn't show the title defined in the template, as it is not located on the <head/>.

As using the Journal Template was not a solution, I tried changing the jedi-template located on /webapps/liferay-jedi-theme/templates.

If I change the title with a static text there was no problem... but if I change the title with a variable from the content structure, it just show the text as if the variable does not exist, which I think is true, because the content did not appear at the time it renders the <head/>...

This is my code:
1
2    <title>$company_name - $the_title - $title.getData() - $title</title>


company_name is shown.
the_title is also shown, but it is the page title, not the content shown title.
title is an attribute from the structure of the content shown. I also tried with other variable names.

Really, I have no clue how to resolve this... I think it is possible somehow...

Please, if you have any idea let me know.

Thank you!
Mariano.
Ray Augé
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
June 13, 2008 6:18 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

Hello Mariano,

Sorry for the late response, but after reading your replies I understand
more your requirement, and I'm sad to inform you that we don't currently
have the ability to manipulate the elements in the "head" of the HTML
doc from a portlet. emoticon

BUT, there is an optional portion of the JSR-286 Portlet
Specification 2.0 Proposal
which DOES define such a mechanism, which
would enable us to make the Journal have the ability to do what you
describe, and I'm on a research mission to see if we can get this in
sometime soon.

I'll quote the portion of the proposal here for reference:
[quote=JSR-286 - Portlet Specification 2.0 (Proposed)]PLT.12.5.4
Setting Markup Head Elements


A portlet can set markup head elements at the response via the
addProperty method with

MimeResponse.MARKUP_HEAD_ELEMENT (value:
"javax.portlet.markup.head.element")
as property name and an org.w3c.dom.Element value.

This property is intended to be a hint to the portal application that
the provided DOM
element should be added to the markup head section of the response to
the client.

Support for this property is optional and the portlet can verify if the
calling portal
supports this property via the MARKUP_HEAD_ELEMENT_SUPPORT
property on the
PortalContext.

Even if the calling portal supports this property, delivery of the DOM
element to the
client cannot be guaranteed, e.g. due to possible security rules of the
portal application or
elements that conflict with the response of other portlets.

For render calls, portlets should set head properties in the render
headers part of the
render lifecycle phase or simply override the
GenericPortlet.doHeaders method (see
PLT.11.1.4.3) in order to run with maximum performance on all portal
implementations.
Not Me
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
June 13, 2008 7:13 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

You rock, Ray!

Your response was fast enough! =)

So, what is your suggestion if I'm moving to Liferay before this is implemented?

I mean, do I create the "headline news" as a Journal Articles and display them with a custom Theme? or should I do it in any other way, so that the future transition has less work?

Thanks! I am looking forward to the new feature! =)
Not Me
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
June 17, 2008 5:58 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Ray,

I saw your comment some time ago and today I was thinking about your comment...

Ray Augé:
(...) I'm sad to inform you that we don't currently have the ability to manipulate the elements in the "head" of the HTML doc from a portlet. emoticon


The forum does allow to change (at least) the page title according to the content shown (no keywords or meta-description, yet). How could this been implemented? Do you know?

Thanks!
Mariano.

PS: Perhaps this would need another thread, but usually nobody replies when creating a new one...
Milan Jaroš
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
April 10, 2009 1:28 AM
Answer

Milan Jaroš

Rank: Expert

Posts: 269

Join Date: August 18, 2008

Recent Posts

I think this is really important. Fuad Efendi posted partial solution in forum but it isn't exactly what Journal Content needs I think.
I'll try to find some solution in near future.
Tony Lim
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
July 31, 2009 10:23 AM
Answer

Tony Lim

Rank: Junior Member

Posts: 90

Join Date: April 14, 2009

Recent Posts

Here's how you get the metadata

themeDisplay.getLayout().getTypeSettingsProperties().getProperty("meta-description_" + themeDisplay.getLocale())
David García González
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
March 2, 2011 4:17 AM
Answer

David García González

Rank: Regular Member

Posts: 127

Join Date: July 14, 2009

Recent Posts

Tony Lim:
Here's how you get the metadata

themeDisplay.getLayout().getTypeSettingsProperties().getProperty("meta-description_" + themeDisplay.getLocale())


I tried this code, but it did not work for me. I changed it to the following code:

1
2#set ($description = $typeSettingsProperties.getProperty("meta-description_$themeDisplay.getLocale()"))
3<meta name="description" content="$description" >
David García González
RE: Re: [Liferay Forums][4. Custom Theme Development] RE: Theme for CMS wit
March 2, 2011 4:33 AM
Answer

David García González

Rank: Regular Member

Posts: 127

Join Date: July 14, 2009

Recent Posts

You could also obtain the meta data importing the jsp top_meta.jspf