0

I would like to pass data such as navigation items or languages supported to the portal_normal.vm file so that it gets displayed on the portal.

I don't have a clue about how to do it. I've seen that in velocity files the data is passed in variables as follows:

    <title>$the_title - $company_name</title>

I would like to do the same for navigation items and other data in my portal but I have no clue how.

Barett
  • 5,826
  • 6
  • 51
  • 55
Marwan Tushyeh
  • 1,505
  • 4
  • 24
  • 47

1 Answers1

2

Liferay's themes have a file called init.vm - this initializes quite a bit of the data. If you don't find it in your theme, it will be loaded from the _styled or _unstyled theme that you can find within the portal (or the portal source).

You can also look at the Java side of the equation: There's a class called VelocityVariablesImpl, this initializes "the other" variables in the context.

In addition, you can have a file named init_custom.vm in your custom theme, where you can add more initialization. This file is meant to be empty in default themes, but as it's included and evaluated, you can add your custom variables and initialize them in here.

Prakash K
  • 11,669
  • 6
  • 51
  • 109
Olaf Kock
  • 46,930
  • 8
  • 59
  • 90