How to add js path to script src into the success.phtml magento2 - frontend

I want implement JS library for the social share coupan code . I have JS Library into the below folder as "c-share.js"
/var/www/html/zamadev/app/design/frontend/Megnor/mag110246_4/Magento_Checkout/templates/js
I want to add script src into the success.phtml file but not getting exact file path. File code as follows:
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /** #var $block \Magento\Checkout\Block\Onepage\Success */ ?>
<div class="checkout-success">
<div class="main-inside-checkout">
<?php if ($block->getOrderId()) :?>
<div id="main-checkout-first">
<?php if ($block->getCanViewOrder()) :?>
<h1 class="order_status">Your order is Confirmed!</h1>
<img src="<?php echo $block->getUrl("pub/media/icon/")?>order-imge.jpg"/>
<p class="order-number"><?= $block->escapeHtml(__('Your order number is: %1.', sprintf('<strong>%s</strong>', $block->escapeUrl($block->getViewOrderUrl()), $block->getOrderId())), ['a', 'strong']) ?></p>
<?php else :?>
<p><?= $block->escapeHtml(__('Your order # is: <span>%1</span>.', $block->getOrderId()), ['span']) ?></p>
<?php endif;?>
<h5><?= $block->escapeHtml(__('Get 25% Off your next order')) ?></h5>
<p class="order-disc-details">When your friends use your referral code to place their first order,you'll both get <span class="off-percentage">25% Off</span>. It's a win win 🙂</p>
</div>
<div id="main-checkout-second">
<p class="main-input-checkout"><input type="text" value="LGL174" id="discounted-code"><button class="button-for-copy" onclick="copyToClipBoard()">COPY</button></p>
</div>
<div class="actions-toolbar">
<div class="primary">
<!-- WhatsApp -->
<a target="_blank" href="https://api.whatsapp.com/send?text=LGL174"><img src="<?php echo $block->getUrl("pub/media/icon/")?>WhatsApp.png"/></a>
<!-- Facebook -->
</div>
<div id="shareBlock"></div>
</div>
<?php endif;?>
<?= $block->getAdditionalInfoHtml() ?>
</div>
</div>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/fontawesome.css" integrity="sha384-jLuaxTTBR42U2qJ/pm4JRouHkEDHkVqH0T1nyQXn1mZ7Snycpf6Rl25VBNthU4z0" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="js/c-share.js"></script>
<script type="text/javascript">
function copyToClipBoard() {
var content = document.getElementById('discounted-code');
content.select();
document.execCommand('copy');
}
$('#shareBlock').cShare({
showButtons: [
'fb',
'line',
'plurk',
'weibo',
'twitter',
'tumblr',
'email'
]
});
</script>
Success.phtml in bollow path
/var/www/html/zamadev/app/design/frontend/Megnor/mag110246_4/Magento_Checkout/templates
I am not getting how to add script src into the success.phtml file (currently added as )

Related

write jpg php Arabic?

I want to write on the picture in Arabic fonts
This is the code that I did, but I could not install the Arabic library correctly
<?php
include('ar-php/src/Arabic.php');
if(isset($_POST['sub']))
{
$font = 'Almarai/Almarai-Bold.ttf';
$font1= "Almarai/Almarai-Light.ttf";
$im =imagecreatefromjpeg("certificate-1.jpg");
$name= $_POST['name'];
$output =$name.".jpg";
$msg="This Certificate is Auto Generated:". date("d/m/Y");
$textColor = imagecolorallocate ($im,0,0,0);
$Arabic = new Arabic('ArGlyphs');
$text = '$name';
$text = $Arabic->utf8Glyphs($text);
// الصورة وحجمها وموقع الخط ونوع الخط ولونه والكتابة
imagettftext($im,80, 0, 2000, 2000,$textColor, $font, ucwords($name));
imagettftext($im, 30, 0, 10, 2400,$textColor, $font1, $msg);
imagejpeg($im,$output);
header('Content-Description: File Transfer');
header('Content-Type: application/image');
header('Content-Disposition: attachment; filename="'.basename($output).'"');
header('Content-Length: ' . filesize($output));
readfile($output);
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<title>
موقع شهادات
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, inital-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="card" style="margin-top:20%">
<div class="card-header bg-success">
<h3 class="text-center text-white">
موقع شهادات تجريبي
</h3>
</div>
<div class="card-body">
<form id="form" method="post" enctype="multipart/form-data">
<div class="form-group">
<label>الاسم:</label>
<input type="text" name="name" autocomplete="off" class="form-control">
</div>
<div class="form-group">
<input type="submit" value="اطبع" name="sub" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
I tried to install the Arabic library, but the following error appears:
Warning: Undefined variable $Arabic in C:\xampp\htdocs\Certificate-Print\index.php on line 16
Fatal error: Uncaught Error: Call to a member function utf8Glyphs() on null in C:\xampp\htdocs\Certificate-Print\index.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Certificate-Print\index.php on line 16
I want to write on the picture in Arabic fonts
This is the code that I did, but I could not install the Arabic library correctly
I want to write on the picture in Arabic fonts
This is the code that I did, but I could not install the Arabic library correctly
You are getting the error because $Arabic is null. I suspect that class name is not called Arabic ?
When I read the docs the class is called I18N_Arabic. So your line should be
$Arabic = new I18N_Arabic ('ArGlyphs');
You have too many things called Arabic for my liking - its a recipe for disaster.

htaccess file url rewrite not creating the required url

Hi i'm creating a multi language php website. I want to create a url like www.domain.com/en and www.domain.com/sp where as my url structure is www.domain.com/index.php?lang=en
Please advise.
Here's my Code for the website:
htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^lang/([^/]*)$ /multi_lang_php/index.php?lang=$1 [L]
</ifModule>
config.php:
<?php
session_start();
if (!isset($_SESSION['lang']))
$_SESSION['lang'] = "en";
else if (isset($_GET['lang']) && $_SESSION['lang'] != $_GET['lang'] && !empty($_GET['lang'])) {
if ($_GET['lang'] == "en")
$_SESSION['lang'] = "en";
else if ($_GET['lang'] == "sp")
$_SESSION['lang'] = "sp";
}
require_once "language/" . $_SESSION['lang'] . ".php";
english / spanish language files are like this:
<?php
$lang = array(
"title" => "PHP Multilang Demo",
"banner" => "MLT",
"home" => "Home",
"pricing" => "Pricing",
"contact" => "Contact",
"description" => "This is explanation about my website.",
"lang_en" => "English",
"lang_sp" => "Spanish",
);
my index.php:
<?php
include "config.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $lang['title'] ?></title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
.footer {
left: 0;
position: fixed;
bottom: 0;
text-align: center;
color: white;
width: 100%;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#"><?php echo $lang['banner'] ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
</ul>
<span class="navbar-text">
Navbar text with an inline element
</span>
</div>
</nav>
<div class="container" style="margin-top: 100px">
<div class="row justify-content-center">
<div class="col-md-6 col-md-offset-3 text-center">
<h1>PHP Multilang Website</h1>
<p>This is a demo website for Multilanguage website</p>
</div>
</div>
</div>
<div class="footer bg-dark">
<?php echo $lang['lang_en'] ?>|
<?php echo $lang['lang_sp'] ?>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>
You need part with RewriteBase /.
RewriteEngine On
RewriteBase /
RewriteRule ^(.+?)/.*$ /multi_lang_php/index.php?lang=$1 [L]
It transforms URL from:
http://www.example.com/en/
into:
http://www.example.com/multi_lang_php/index.php?lang=en

EJS pages with parameters and partials hang

I have a weird problem happening on my ejs pages. When I include header and footer partials on any page that loads with a route parameter, the page hangs. When I hit the stop button on the page load, the page loads fine. On pages that do not have a route parameter, I have no issues.
I get the following error in node (the page loads with a route parameter called eventid):
params for results to find by eventid: { eventid: 'app.css' }
SOMETHING WENT WRONG GETTING RESULT: { CastError: Cast to ObjectId
failed for value "app.css" at path "event_id" for model "results"
I added a comment below after posting this question. I figure I would add some information here to give more details. My app.css link in the header partial is the cause of my problems. When I comment it out it works fine. In node, I've used the following line to include files in my resources folder which is in the root of my app. This works fine except when i load it using the partials footer. app.use(express.static(path.join(__dirname, 'resources')))
Sample pages...
<% include ../partials/header %>
<h3>Sample page</h3>
<% include ../partials/footer %>
Header partial...
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="google.com"><i class="fa fa-futbol-o"></i> PESers Only</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Link 1</li>
<li>Link 2</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Register</li>
<li>Log In</li>
<li>Log Out</li>
</ul>
</div>
</div>
</nav>
<!-- <div id="wrapper"> -->
<div class="container">
Footer Partial...
</div> <!-- close container -->
<!-- </div> close wrapper -->
</body>
<footer class="footer">
<div class="footer-content list-inline">
Footer text | Contact Us
</div>
</footer>
</html>
It turns out that the problem I was having was related to the referencing of external files (in this case my app.css file). I was referencing it in my ejs header partial using: <link rel="stylesheet" type="text/css" href="app.css"> however the error was fixed when I added a backslash to the href: <link rel="stylesheet" type="text/css" href="/app.css">.
Essentially, when referencing resources such as a css file that is in a folder that is declared in app.use (app.use(express.static(__dirname + "/resources"));) you need the backslash to reference the root of your application and then access the resource you plan to reference in the ejs views.

How to add a custom wordpress isotope project portfolio pagination

How can I add a pagination to my isotope portfolio page?
I want each filter work with a max item of 8 and use pagination to check next 8 items.
Below is my custom Template Name: Portfolio
<?php $t =& peTheme(); ?>
<?php $title = get_the_title(); ?>
<?php $pcontent = get_the_content(); ?>
<?php $pcontent = apply_filters( 'the_content', $pcontent ); ?>
<?php $project =& $t->project; ?>
<?php list($portfolio) = $t->template->data(); ?>
<?php $content =& $t->content; ?>
<div class="container">
<div class="row">
<div class="span12">
<h1><?php echo $title; ?></h1>
</div>
</div>
<div class="row">
<div class="span12">
<nav class="portfolio-filter clearfix">
<ul>
<?php $project->filter('',"keyword"); ?>
</ul>
</nav>
</div>
<hr class="main-hr-sm">
<?php echo $pcontent; ?>
</div>
<div class="row portfolio-container">
<?php while ($content->looping()):
$meta =& $content->meta(); ?>
<div class="span3 portfolio-item <?php $project->filterClasses(); ?>">
<a href="<?php echo $t->image->resizedImgUrl($content->get_origImage(),1000,1000); ?>" class="fancybox" data-portfolio="<?php $content->slug(); ?>">
<img src="<?php echo $t->image->resizedImgUrl($content->get_origImage(),460,300); ?>" alt="<?php echo esc_html(get_the_content()); ?>">
</a>
<div class="caption">
<?php $content->content(); ?>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
Pagination isn't built into Isotope so you'd have to build it from the ground up. Here is a good tutorial on how to do that with Wordpress and Isotope v1. Keep in mind the tutorial is using Isotope v1 so you'll have to change it if you want to use Isotope v2 but the general concepts in the tutorial should still be very helpful.

AUI is not defined and Liferay is not defined error in jsp page?

I am using my custom portlet in liferay.
but somehow when i run my portlet i m having following error in error console
Timestamp: 12/10/2012 12:33:19 PM
Error: ReferenceError: AUI is not defined
Source File: http://localhost:8080/eMenuAdvertise-portlet/js/jquery.min.js
Line: 4
Timestamp: 12/10/2012 12:34:21 PM
Error: ReferenceError: Liferay is not defined
Source File: http://localhost:8080/eMenuAdvertise-portlet/js/jquery.min.js
Line: 3
So why this error comes in my jsp page for some jquery?
<%# page import="net.sf.jasperreports.engine.JRException" %>
<%# page import="net.sf.jasperreports.engine.JasperExportManager" %>
<%# page import="net.sf.jasperreports.engine.JasperFillManager" %>
<%# page import="net.sf.jasperreports.engine.JasperPrint" %>
<%# page import="net.sf.jasperreports.engine.JasperPrintManager" %>
<%#page import="com.liferay.portal.model.Role"%>
<%# include file="/init.jsp"%>
<%#page import="com.liferay.portal.model.Organization"%>
<%#page import="com.liferay.portal.util.PortalUtil"%>
<style>
.borderColor{border: 1px solid #C62626;}
</style>
<portlet:renderURL var="ajaxaddnewrestURL">
<portlet:param name="jspPage" value="/jsps/ajaxnewrest.jsp" />
</portlet:renderURL>
<portlet:renderURL var="editrestURL">
<portlet:param name="jspPage" value="/jsps/Ajax_editrest.jsp" />
</portlet:renderURL>
<portlet:renderURL var="restListURL">
<portlet:param name="jspPage" value="/jsps/rest.jsp" />
</portlet:renderURL>
<portlet:renderURL var="reportURL">
<portlet:param name="jspPage" value="/htmlreport/report.html" />
</portlet:renderURL>
<portlet:renderURL var="renderURL ">
<portlet:param name="param-name" value="param-value" />
</portlet:renderURL>
<%-- <portlet:resourceURL var="ReportId" id="generate_report"></portlet:resourceURL> --%>
<portlet:resourceURL var="addToDo" id="generate_report"></portlet:resourceURL>
<script type="text/javascript" src="<%=request.getContextPath()%>/lib/chosen/chosen.jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.3/themes/south-street/ui.all.css" type="text/css">
<script src="<%=request.getContextPath()%>/js/datepickernew/jquery-1.8.3.js"></script>
<script src="<%=request.getContextPath()%>/js/datepickernew/jquery-ui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.validate.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/lib/chosen/chosen.jquery.min.js"></script>
<%
System.setProperty("java.awt.headless", "true");
System.out.println(java.awt.GraphicsEnvironment.isHeadless());
String loading_img_path = request.getContextPath()+"/img/ajax_loader.gif";
boolean isReseller=false; ///advertiser if flag is false else Reseller
List<Role> role_list_page=themeDisplay.getUser().getRoles();
for(Role role_name:role_list_page){
if(role_name.getName().equals("Reseller")){
isReseller=true;
break;
}
}%>
<script>
</script>
<script>
$(function() {
$("#Start_validBeforeDatepicker").datepicker({
numberOfMonths: 1,
showButtonPanel: true,
onClose: function( selectedDate ) {
$( "#End_validAfterDatepicker" ).datepicker( "option", "minDate", selectedDate );
}
});
$("#End_validAfterDatepicker").datepicker({
numberOfMonths: 1,
showButtonPanel: true,
onClose: function( selectedDate ) {
$( "#Start_validBeforeDatepicker" ).datepicker( "option", "maxDate", selectedDate );
}
});
// $("#validBeforeDatepicker").datepicker({ minDate: 0 });
$('#Start_validBeforeDatepicker,#End_validAfterDatepicker').datepicker();
});
</script>
<script type="text/javascript">
$(".chzn-select").chosen();
$(".chzn-select-deselect").chosen({
allow_single_deselect : true
});
$(document).ready(function() {
$(".ui-datepicker").css("display","none");
});
</script>
<script type="text/javascript">
function update_rest(addToDo){
var camp_ID =document.getElementById('camp_id').value;
var f_start_date =document.getElementById('Start_validBeforeDatepicker').value;
var f_end_date =document.getElementById('End_validAfterDatepicker').value;
$.ajax({
url :addToDo,
data: {"rest_name":camp_ID,
"f_start_date":f_start_date,
"f_end_date":f_end_date,
"CMD":camp_ID},
type: "GET",
timeout: 20000,
dataType: "text",
success: function(data) {
alert("");
alert ( " liferay url : "+ Liferay.PortletURL.createRenderURL());
alert( "row1: " + createRowURL(1) );
alert( "row2: " + createRowURL(2) );
$("#mydiv").load("<%=renderURL.toString()%>");
alert(data);
}
});
}
function createRowURL( row ) {
var portletURL = new Liferay.PortletURL();
portletURL.setParameter("rowNumber", row );
return portletURL.toString();
}
function createRenderURL(str) {
alert("");
var renderURL = Liferay.PortletURL.createRenderURL();
alert("hi");
renderURL .setParameter("jspPage",str);
renderURL .setPortletId("eMenuAdvertise_WAR_eMenuAdvertiseportlet");
// i.e. your-unique-portlet-id can be like "helloworld_WAR_helloworldportlet"
}
</script>
<nav>
<div id="jCrumbs" class="breadCrumb module">
<ul>
<li><i class="icon-home"></i></li>
<li>Reseller</li>
<li>Restaurants</li>
</ul>
</div>
</nav>
<div class="row-fluid">
<div class="span12">
<div id="successMsg" style='display:none;' class="alert alert-success"></div>
<div id="errorMsg" style='display:none;' class="alert alert-error"></div>
<h3 class="heading">
Statistics
</h3>
<%String restId = request.getParameter("hide1");%>
<portlet:actionURL name="generateReport" var="reportURL"></portlet:actionURL>
</div>
<div class="">
<div class="">
<div class="">
<div style="float: right">
<p>
<label style="width: 100px"><b>Campaign</b></label>
</p>
<select id="camp_id" name="camp_id"
data-placeholder="- Select Restaurants -" class="chzn-select"
multiple><%
String status = null;
List<campaign> camp_listObj;
if(isReseller)
{
camp_listObj= campaignLocalServiceUtil.getAllCampaignByOrganizations(themeDisplay);
}
else
{
camp_listObj = campaignLocalServiceUtil.getAllCampaignByOrganizationId(themeDisplay);
}
for (int i = 0; i < camp_listObj.size(); i++) {
%>
<option value=<%=camp_listObj.get(i).getPrimaryKey()%>><%=camp_listObj.get(i).getName().toString()%></option>
<%
}
%>
</select>
</div>
<div style="float: left;">
<p>
<button onclick="update_rest('<%=addToDo%>');" class="btn btn-success">GenerateReports</button>
</p>
<b>Start Date</b> <input type="text" style="width: 100px"
id="Start_validBeforeDatepicker" name="validTodayDatepicker"
readonly="true"> <b>End Date</b> <input type="text"
readonly="true" style="width: 100px" id="End_validAfterDatepicker"
name="validAfterDatePicker">
</div>
</div>
</div>
<div style="visibility: hidden;">
<input type="hidden" name="report_path" id="report_path" value="">
</div>
<%
System.setProperty("java.awt.headless", "true");
System.out.println(java.awt.GraphicsEnvironment.isHeadless());
%>
</div>
</div>
<div class="bordercolor" id="mydiv">
</div>
<script type="text/javascript">
function editrestaurant(id){
$(".span12").html("<img class='ajax-loader' src='<%=loading_img_path%>'/>");
$.ajax({
type:'post',
url:'<%=editrestURL.toString()%>',
data:{restId:id},
success:function(data){
$(".main_content").html(data);
}
});
}
function newrestaurant(){
$(".span12").html("<img class='ajax-loader' src='<%=loading_img_path%>'/>");
$.ajax({
type:'post',
url:'<%=ajaxaddnewrestURL.toString() %>',
data:{},
success:function(data){
$(".main_content").html(data);
}
});
}
</script>
portlet.vm
#set ($portlet_display = $portletDisplay)
#set ($portlet_id = $htmlUtil.escapeAttribute($portlet_display.getId()))
#set ($portlet_title = $portlet_display.getTitle())
#set ($portlet_back_url = $htmlUtil.escapeAttribute($portlet_display.getURLBack()))
<section id="portlet_$portlet_id">
$portlet_display.writeContent($writer)
</section>
portal_normal.vm
#parse ($init)
<html class="#language("lang.dir")" dir="#language("lang.dir")" lang="$w3c_language_id">
<head>
</head>
<body class="$css_class">
<div id="wrapper">
<div id="content">
$theme.wrapPortlet("portlet.vm", $content_include)
</div>
</div>
</body>
$theme.include($bottom_include)
</html>
portal_popup.vm
<!DOCTYPE html>
#parse ($init)
<html dir="#language ("lang.dir")" lang="$w3c_language_id">
<head>
<title>$the_title</title>
$theme.include($top_head_include)
</head>
<body class="portal-popup $css_class">
$theme.include($content_include)
$theme.include($bottom_ext_include)
</body>
</html>
navigation.vm
<nav class="$nav_css_class" id="navigation">
<h1>
<span>#language("navigation")</span>
</h1>
<ul>
#foreach ($nav_item in $nav_items)
#if ($nav_item.isSelected())
<li class="selected">
#else
<li>
#end
<a href="$nav_item.getURL()" $nav_item.getTarget()><span>$nav_item.icon() $nav_item.getName()</span></a>
#if ($nav_item.hasChildren())
<ul class="child-menu">
#foreach ($nav_child in $nav_item.getChildren())
#if ($nav_child.isSelected())
<li class="selected">
#else
<li>
#end
<a href="$nav_child.getURL()" $nav_child.getTarget()>$nav_child.getName()</a>
</li>
#end
</ul>
#end
</li>
#end
</ul>
</nav>
In the <script> you have two javascript functions - createRowURL and createRenderURL which make use of the Alloy UI scripts as follows:
function createRowURL( row ) {
var portletURL = new Liferay.PortletURL(); // this is the line using AUI
portletURL.setParameter("rowNumber", row );
return portletURL.toString();
}
function createRenderURL(str) {
alert("");
var renderURL = Liferay.PortletURL.createRenderURL(); // this is the line using AUI
alert("hi");
renderURL .setParameter("jspPage",str);
renderURL .setPortletId("eMenuAdvertise_WAR_eMenuAdvertiseportlet");
// i.e. your-unique-portlet-id can be like "helloworld_WAR_helloworldportlet"
}
So I would suggest instead of using the <script> ... </script> tag use <aui:script> ... </aui:script> tags (this loads all the AUI and Liferay modules), for using this tag you would need to define the taglib in your jsp like:
<%# taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>`
Edit (after seeing the theme templates):
I can see that in your portal_normal.vm you have removed the following lines from <head> and <body> tags respectively:
$theme.include($top_head_include) <!-- this statement is removed from <head> -->
$theme.include($body_top_include) <!-- this statement is removed from <body> -->
Please include these statements back in the theme templates and your scripts would work. The statement $theme.include($top_head_include) this is responsible to include all the AUI related stuff (javascripts, functions etc) and also some variables in the request attribute.
Note: Please always be careful while removing anything from themes and hooks. You should always know what is the purpose of the statements you are removing or modifying.
Hope this helps.

Resources