Forums

Home » Liferay Portal » English » Liferay Legacy »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Przemek Ch
[RESOLVED] How to use liferay UI taglibs from Velocity?
September 26, 2008 12:32 PM
Answer

Przemek Ch

Rank: Junior Member

Posts: 44

Join Date: March 26, 2007

Recent Posts

Hi,

I try to use taglibs in velocity files but I don't know how.
Its easy to call a defined taglib variable as in navigation.vm file
$theme.journalContentSearch()


but how can I call other taglibs like breadcrumb
in jsp its easy

<...liferay-ui:breadcrumb.....

and how can I put this tag in a Vm file?
Jorge Ferrer
RE: How to use liferay UI taglibs from Velocity?
July 29, 2007 1:33 PM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2658

Join Date: August 31, 2006

Recent Posts

Hi Przemek,

You can access some of the tags using the $taglibLiferay variable. See the class VelocityTaglib for details.
Przemek Ch
RE: How to use liferay UI taglibs from Velocity?
July 30, 2007 2:53 AM
Answer

Przemek Ch

Rank: Junior Member

Posts: 44

Join Date: March 26, 2007

Recent Posts

Hello Jorge,
Thx for advices
It works emoticon


in VelocityTaglib class:

    public String breadcrumb()  throws Exception {
        _res.recycle();
        BreadcrumbTag.doTag(_ctx, _req, _res);
        return _res.getString();
    }


in BreadcrumbTag class:


    public static void doTag(ServletContext ctx, HttpServletRequest req,
                                 HttpServletResponse res)
                                 throws IOException, ServletException {

        RequestDispatcher rd = ctx.getRequestDispatcher(_PAGE);
        rd.include(req, res);
    }


and now I've got a nice breadcrumb in my navigation.vm emoticon

 
    <div id="navigation" >
            <table width="100%" cellpadding="10">
        <tr valign="middle">
         <td style="padding-left: 10px;">
                $theme.breadcrumb()
             </td>
                 <td align="right">
            <div id="search_window">
                       $theme.journalContentSearch()
            </div>
                </td>
                </tr>
            </table>
    </div>
Thomas Ballerstedt
RE: How to use liferay UI taglibs from Velocity?
May 2, 2008 9:43 AM
Answer

Thomas Ballerstedt

Rank: Junior Member

Posts: 28

Join Date: February 1, 2005

Recent Posts

Hi you all,

I want to implement the use of Tag <liferay:actionURL>, especially in my VM journal content template. But I had no luck - unfortunaletly.

I tried:

$taglibLiferay.actionUrl("73_INSTANCE_xxx") or $theme.actionUrl("73_INSTANCE_xxx") - it's not resolved.
$theme.journalContentSearch() is working pretty in portal_normal.vm, BUT NOT in the VM Template code of my Journal Template.

Does the code processing differ from the *.vm files in the theme pack from the VM Templates in Journal Templates? An if - how?

Any hints are welcome!

regards,
Thoimas
Jorge Ferrer
RE: How to use liferay UI taglibs from Velocity?
May 4, 2008 12:12 PM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2658

Join Date: August 31, 2006

Recent Posts

Hi Thomas,

Yes, the execution environments of the Journal Article templates and the themes are very different. In particular the former is more limited and not all functionalities of the latter are available (admittedly it needs to have better documentation). I'm not sure you can build URLs to other portlets from a portlet the way you want (although you can always use friendly URLs) but in any case I would check Journal Internal API for details.
Thomas Ballerstedt
RE: How to use liferay UI taglibs from Velocity?
May 6, 2008 3:25 AM
Answer

Thomas Ballerstedt

Rank: Junior Member

Posts: 28

Join Date: February 1, 2005

Recent Posts

Hi Jorge,

thanx for the information. I'll try my very best. What I want is to do something like IPC; I want to call another portlet fropm my Jurnal VM Template and give it parameters / attrributes.


regards
Thomas
Fuad Efendi
RE: How to use liferay UI taglibs from Velocity?
June 26, 2009 10:31 AM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 136

Join Date: April 5, 2007

Recent Posts

I am browsing source code trying to understand how $theme (instance of ThemeImpl) is connected to VelocityTaglib...

I found this in ThemeUtil:

        velocityContext.put("themeServletContext", themeServletContext);
        velocityContext.put("taglibLiferay", velocityTaglib);
        velocityContext.put("theme", velocityTaglib);


And also this in VelocityVariables:

velocityContext.put("theme", theme);


It is confusing... VelocityVariables - for Journal only?
neelam bhandari
RE: [RESOLVED] How to use liferay UI taglibs from Velocity?
November 25, 2011 4:33 AM
Answer

neelam bhandari

Rank: Junior Member

Posts: 99

Join Date: August 16, 2011

Recent Posts

Hi all,
Is it possible to set the portlet url for breadcrumb in velocity template? Because it has initialisation #breadcrumb() something like this how to set the liferay-ui:breadcrumb:portletURL ?

Regards
Neelam