Change order of Title tag in moodle login page - moodle

Currently Moodle add Content-Type meta Tag
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
after Title tag
<title>Mount Orange School: Log in to the site</title>
within Head tag.
<head>
<title>Mount Orange School: Log in to the site</title>
<link rel="shortcut icon" href="https://school.demo.moodle.net/theme/image.php/boost/theme/1511289361/favicon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...
...
</head>
How can we change this order with minimum change in moodle3.1 core(https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/login/index.php#L374). Putting Content Type meta tag on top within Head tag. Something like this.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mount Orange School: Log in to the site</title>
<link rel="shortcut icon" href="https://school.demo.moodle.net/theme/image.php/boost/theme/1511289361/favicon" />
...
...
</head>
We are using http://nutch.apache.org/ and it is not reading title if Content type Meta is not defined as first tag in Head.
Ref1: view-source:https://school.demo.moodle.net/login/index.php
Ref2: https://school.demo.moodle.net/login/index.php
Ref3: https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/login/index.php#L374

There are two ways of doing it.
Change the core code here https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/theme/bootstrapbase/layout/columns1.php#L30
Create Custom theme and import base theme and make changes there.
https://edwiser.org/blog/create-child-theme-moodle/
https://docs.moodle.org/dev/Themes
Change which require is
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
.....
to
<head>
<?php echo $OUTPUT->standard_head_html() ?>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
....

Related

yii 1.1 select2 jquery conflict with yii jquery

I am working on a project in yii, in which i am using jquery select2 extension, I have created a searchable dropdown list using select2 extension in localhost/business/package/create page, now when i want to create a package the drop down list just becomes drop down, not searchable, unless i remove this line from my layout <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script>. After that i can create the package,with my seachable drop down list, but my rest of the pages are not scrolling. If i open the view source of package/create these files are already added
<script type="text/javascript" src="/businessadvisor/assets/f81f8ab/jquery.js"></script>
<script type="text/javascript" src="/businessadvisor/assets/1075462/select2.js"></script>
so the crux is a because of a single file, my rest of the pages are not scrolling, nor clicking etc. so what is the solution to deal with this conflict.
You are including jQuery multiple times, so the second inclusion will overwrite all the already included plugins.
You can use the scriptMap option to specify the location of jQuery for the whole site.
'components'=>array(
...
'clientScript'=>array (
'scriptMap'=>array(
'jquery.js'=>'//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js',
),
...
),
...
),
Ok here is the answer. The problem was, when i commented out <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script> from my admin.php (my layout), drop down in package/createstart working, while the rest of the pages becomes stuck, not scrolling nor clicking. so one file was creating a whole problem, to solve this, you need to go into your custom.jsand replace $ with jQuery and save it. Now I had below files under my footer widget.
<!-- <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script>-->
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/bootstrap.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/slimmenu.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/bootstrap-datepicker.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/bootstrap-timepicker.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/nicescroll.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/dropit.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/ionrangeslider.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/icheck.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/fotorama.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/typeahead.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/card-payment.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/magnific.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/owl-carousel.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/fitvids.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/tweet.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/countdown.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/gridrotator.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/custom.js"></script>
I commented out <!-- <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script>-->jquery and in header of my layout having these files
<head>
<title>Business Advisor,Where you give ratings and reviews</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="keywords" content="Template, html, premium, themeforest" />
<meta name="description" content="Traveler - Premium template for travel companies">
<meta name="author" content="Tsoy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- GOOGLE FONTS -->
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600' rel='stylesheet' type='text/css'>
<!-- /GOOGLE FONTS -->
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/font-awesome.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/icomoon.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/styles.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/mystyles.css">
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/modernizr.js"></script>
</head>
so what i did, i copied this code
<?php
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');?> <!-- put these files in admin.php so that conflcit will resolve from select2 extension select2.php-->
from my select2.php and paste in my header like this.
<head>
<title>Business Advisor,Where you give ratings and reviews</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="keywords" content="Template, html, premium, themeforest" />
<meta name="description" content="Traveler - Premium template for travel companies">
<meta name="author" content="Tsoy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- GOOGLE FONTS -->
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600' rel='stylesheet' type='text/css'>
<!-- /GOOGLE FONTS -->
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/font-awesome.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/icomoon.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/styles.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/mystyles.css">
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/modernizr.js"></script>
<?php
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');?> <!-- put these files in admin.php so that conflcit will resolve from select2 extension select2.php-->
</head>
Now the jquery has been registered. and now my every page, even package/create
is working, every thing is scrolling, no conflict at all. Cheers :)

Phonegap build 3.7, HTML, window.open redirect on iphone

I am trying to do a simple redirect in a Phonegap built (version 3.7) from the opening index.html to another html (main2b.html) on an iphone with no success. It works fine on Android. This is a simplified test of what I need to do.
If I window.location.href='http://www.google.com' as an example it DOES NOT work. (and yes I have white listed it in my config.xml)
If I window.location.href='main2b.html' it just spins and does NOT work either.
For testing purposes the main2b.html is just a simple 'hello' in a div.
I have tried various pathing options of main2b.html with no success so I feel it is not a pathing issue. Both html files are in the same location.
Here is the code sample. Would appreciate any thoughts. This seems like such a simple thing and cannot figure out what is wrong.
Once this simple test works, I need to do something like this where I will detect if my app is 'offline' and as such go to a different html file. This is why I am doing this before any jquery/mobile init stuff which would come later if I detect I am 'online'.
The index.html code:
<!DOCTYPE html>
<html>
<head>
<title>The Conspiracy Show</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1 user-scalable=no, " />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- Phonegap build stuff required ----------- -->
<script src="cordova.js"></script>
<!------------------------>
<script>
function onLoad(){
alert('here at onLoad');
document.addEventListener("deviceReady", deviceReady, false);
}
function deviceReady() {
alert('here at deviceReady')
window.location.href = "main2b.html";
}
</script>
</head>
<body onload="onLoad()">
</body>
</html>
main2b.html looks like this
<!DOCTYPE html>
<html>
<head>
<title>The Conspiracy Show App</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
<meta name="keywords" content="conspiracy Richard Syrett talk show Coasttocoastam paranormal callIn"/>
<!-- Required Stuff for PhoneGap prevent page flickering in iOS----------- -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- Phonegap build stuff required ----------- -->
<script src="cordova.js"></script>
</head>
<body style="background:#2D5873;" >
<div align="center" style="margin:0px; padding:0px;">
Hello
</div>
</body>
</html>
I found my own problem. Apparently, in iPhone, if you dont specifically close the splash screen (which can only be done after deviceReady), any redirection will not work. On android, the splash screen close can be done immediately. Anyway, problem solved.

Facebook URL Share :Default Wordpress Thumbnail for my website and thumbnail image for each post

Hi guys i developed this site:
http://viviendodiferente.mx/
It works awesome, but im currently having some troubles with facebook when you share the url it shows another image im not currently setting on my meta tags:
<meta property="og:url" content="http://viviendodiferente.mx">
<meta property="og:title" content="Viviendo Diferente">
<meta property="og:site_name" content="Viviendo Diferente">
<meta property="og:description" content="Viviendo Diferente bLOG">
<meta property="og:type" content="Website">
<meta property="og:image" content="http://www.servervistadesarrollos.com/sites/viviendodiferente/wp-content/themes/viviendo2/images/logoViviendo2.jpg">
And when i debug it, it says:
Meta Tags In Body: Your page has meta tags in the body instead of the head. This may be because your HTML was malformed and they fell lower in the parse tree.
Please fix this in order for the tags to be usable.
Also when you like inside a post it keep showing a default image instead of the thumbnail.
Any ideas? I was using easy facebook share thumbnails but its just not working at all ;/
Copy and paste all meta tags inside the <head>
Sample:
<head>
<link rel="image_src" href="http://www.servervistadesarrollos.com/sites/viviendodiferente/wp-content/themes/viviendo2/images/logoViviendo2.jpg"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta property="fb:app_id" content="590102141003905"/>
<title>Viviendo Diferente</title>
<script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
var template = 'http://viviendodiferente.mx/wp-content/themes/viviendo2';
var total = 56;
//alert(total)
</script>
<script src="http://viviendodiferente.mx/wp-content/themes/viviendo2/js/jqueryeasing.js" type="text/javascript" charset="utf-8"></script>
<script src="http://viviendodiferente.mx/wp-content/themes/viviendo2/js/plugins.js" type="text/javascript" charset="utf-8"></script>
<script src="http://viviendodiferente.mx/wp-content/themes/viviendo2/js/isotope.js" type="text/javascript" charset="utf-8"></script>
<script src="http://viviendodiferente.mx/wp-content/themes/viviendo2/js/infinitescroll.js" type="text/javascript" charset="utf-8"></script>
<script src="http://viviendodiferente.mx/wp-content/themes/viviendo2/js/main.js" type="text/javascript" charset="utf-8"></script>
<link href='http://fonts.googleapis.com/css?family=Raleway:400,500,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="http://viviendodiferente.mx/wp-content/themes/viviendo2/style.css" />
<link rel="icon" type="image/jpg" href="http://viviendodiferente.mx/wp-content/themes/viviendo2/images/fviviendo.jpg">
<!--start facebook-->
<meta property="og:url" content="http://viviendodiferente.mx">
<meta property="og:title" content="Viviendo Diferente">
<meta property="og:site_name" content="Viviendo Diferente">
<meta property="og:description" content="Viviendo Diferente bLOG">
<meta property="og:type" content="Website">
<meta property="og:image" content="http://www.servervistadesarrollos.com/sites/viviendodiferente/wp-content/themes/viviendo2/images/logoViviendo2.jpg">
</head>

Is this XHTML document valid for parsing with the iPhone

I would be grateful if someone could clarify if this document is valid for xhtml parsing using the iphone SDK using xpaths:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>East Lancs Radio - Now Playing</title>
<META HTTP-EQUIV="REFRESH" CONTENT="45">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="player-currently-playing">
Currently Playing
<div class="player-track">
Lush
</div>
<div class="player-artist">
Ladykillers
</div>
</div>
<div id="player-playing-next">
Playing Next
<div class="player-track">
Javine
</div>
<div class="player-artist">
Surrender (Your...
</div>
</div>
</body>
</html>
I'm trying to extract the currently playing player-track 'lush' and player-artist 'ladykillers' through using xpath. If I do an xpath search for: //#class and then print the result to screen, I get player-track, player-artist.. etc outputted?
Am I missing something fairly obvious here?
Thanks
Dan
The W3C Markup Validation Service comes up with 9 errors in this document.
So, this is not a valid XHTML document, for iPhone usage or otherwise.
Your XPath result is giving you what you're asking for which is the values of the class attributes.
To get the currently playing player-track use:
//*[#id = 'player-currently-playing']/*[#class = 'player-track']/text()
and to get the currently playing player-artist use:
//*[#id = 'player-currently-playing']/*[#class = 'player-artist']/text()

Facebook Like button

I recently got an fb social plugin. In particular, the "Like" button for my website. Everything works okay it's just that when I click on the button, it reads "You like:http://www.branchout.com/index.php?id=3"
I don't want it to say what URL i like. I want it to say the content of what I'm liking (in this case, it's a quote).
One more thing, my domain name is "thebranchout.com", not "branchout.com"
and thoughts, guys?
The head of the code is this:
<head>
<title><?php echo $last; ?>) <?php echo $first; ?></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="Sharing stuff, quotes, politicians, athletes" />
<meta name="keywords" content="Sharing stuff, quotes, politicians, athletes" />
<meta property="og:title" content="(<?php echo $last; ?>) <?php echo $first; ?>"/>
<meta property="og:type" content="song" />
<meta property="og:type" content="cause"/>
<meta property="og:url" content="http://www.thebranchout.com/index.php?id=<?php echo $jeeves; ?>"/>
<meta property="og:site_name" content="The BranchOut"/>
<meta property="og:description" content="(<?php echo $last; ?>) <?php echo $first; ?>"/>
<link rel="stylesheet" type="text/css" href="style-wampler.css" media="" />
<script type="text/javascript" src="JS/jquery-1.3.2.min.js"></script>
<script src="JS/jquery.jqEasyCharCounter.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#slide").hide();
$('.button').click(function checkPass(){
$("#slide").slideDown();
});
$('textarea#limit').jqEasyCounter({
'maxChars': 99,
'maxCharsWarning': 95,
'msgFontSize': '14px',
'msgFontColor': 'black',
'msgFontFamily': 'Verdana',
'msgTextAlign': 'left',
'msgWarningColor': 'red',
'msgAppendMethod': 'insertBefore'
});
});
</script>
The iframe is this:
<iframe src="http://www.facebook.com/plugins/like.php?href=thebranchout.com/index.php?id=<?php echo $jeeves; ?>&layout=standard&show_faces=true&width=450&action=like&font=lucida+grande&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
Feed your page to URL Linter and it will tell you how facebook grabs information about your page.
You need to put open graph tags in your page which Facebook uses to produce a title, image, and description on news feeds, and also a title to replace the URL that you're seeing.
http://developers.facebook.com/docs/opengraph/
I think facebook parses the page for info to use. Make sure the page at that URL has a valid title set in the header. I am not sure what they pull to use for descritpion etc. though.