2
votes

I'm frontend developer working with liferay 6.2 CE. Liferay is served with AlloyUI, but not jquery. So we included it in the js theme folder and loaded it in portal_normal.vm :

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

    <meta content="initial-scale=1.0, width=device-width" name="viewport" />

    $theme.include($top_head_include)

    <!-- All JS Here ! -->
    <script type="text/javascript" src="$javascript_folder/jquery-1.11.2.min.js"></script>

    <!-- Add fancyBox main JS and CSS files -->
    <script type="text/javascript" src="$javascript_folder/fancybox/jquery.fancybox.js?v=2.1.5"></script>
    <link rel="stylesheet" type="text/css" href="$javascript_folder/fancybox/jquery.fancybox.css?v=2.1.5" media="screen" />
</head>

No problem so far.

When I need to edit a freemarker template and go through "admin -> content -> manage -> templates", I am able to edit my templates. Fine.

But when I need to edit an asset-publisher template, through the configuration portlet menu, the console returns me a jQuery undefined error.

I have some jquery stuff in my main.js theme file. This is where the error comes from. But there's no error somewhere else.

When I show up the page source, my jquery.js is loaded on top of any other js file. I can't figure it out by myself, I'm absolutly not familiar with Liferay, Eclipse and Java ; I come from frontend. I would be greatfull for any help here.

Thanks

1
Did you add your jquery-1.11.2.min.js file in the _diffs/js folder?, If you added, you can directly use jquery by including your code in <script> tags.ASR
It's placed in the theme folder /site-theme/js/Neovea
can u show me how did access the jquery.js in portal_normal.vm?ASR
<script src="$javascript_folder/jquery-1.4.2.min.js"></script>ASR
Check my code above, this exactly what I put.Neovea

1 Answers

1
votes

The configuration jsp pages are not based on the "portal_normal.vm" velocity template but rather on the "portal_pop_up.vm". Maybe that is where the problem lies.