I'm trying to attach this php code to html file and cant figure out - authentication

php require('includes/config.php');
if(!$user->is_logged_in()){ header('Location: login.php'); }
$title = 'main';
require('layout/header.php');
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href=
'http://fonts.googleapis.com/css?family=Lora:400,700|Open+Sans:400,300,700'
rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="css/reset.css" type="text/css" />
<!-- CSS reset -->
<link rel="stylesheet" href="css/style.css" type="text/css" />
<!-- Resource style -->
<script src="js/modernizr.js" type="text/javascript">
<title>
main menuw
</title>

PHP code should be between the '<?php' and '?>'
Your server should support PHP

Related

ASP.NET CORE Kendo UI TextBoxFor fails to load

I am using Kendo ASP.NET Core MVC controls.
I am using my form controls using Kendo() helpers like
- Html.Kendo().TextBoxFor(x=>x.Title)
- Html.Kendo().DropDownListFor(x=>x.TypeId)
- Html.Kendo().EditorFor(x=>x.Description)
all controls works fine except Kendo().TextBoxFor, it throws the following error on console
Uncaught TypeError: jQuery(...).kendoTextBox is not a function
Here is how my scripts and JS refereed in Head tag page
<link href="~/css/style.css" rel="stylesheet" integrity="" asp-append-version="true" />
<link href="~/css/colors/green.css" rel="stylesheet" integrity="" asp-append-version="true" />
<link href="~/lib/flickity/flickity.css" rel="stylesheet" media="screen" />
<link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.common.min.css" integrity="" />
<link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.metro.min.css" integrity="" />
<link href="~/lib/kendo-ui/styles/kendo.bootstrap-v4.min.css" rel="stylesheet" />
<script src="~/js/jquery-3.3.1.min.js" integrity=""></script>
<script src="~/js/jquery-migrate-3.0.0.min.js" integrity=""></script>
<script src="~/lib/kendo-ui/js/jszip.min.js"></script>
<script src="~/lib/kendo-ui/js/kendo.all.min.js" integrity=""></script>
<script src="~/lib/kendo-ui/js/kendo.aspnetmvc.min.js" integrity=""></script>
Cant find any related issues online much.
Here is the full console error:
Solution:
Probably something wrong with my local Kendo JS libraries. Updated the scripts and CSS as below and all worked fine.
<link href="https://kendo.cdn.telerik.com/2020.2.617/styles/kendo.common-bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2020.2.617/styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2020.2.617/styles/kendo.metro.min.css" rel="stylesheet" type="text/css" />
<script src="~/js/jquery-3.3.1.min.js" integrity=""></script>
<script src="~/js/jquery-migrate-3.0.0.min.js" integrity=""></script>
<script src="https://kendo.cdn.telerik.com/2020.2.617/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2020.2.617/js/kendo.all.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2020.2.617/js/kendo.aspnetmvc.min.js"></script>

How can I get Pelican to use the save_as meta to also populate the canonical og:url head info?

Using current Pelican and the pelican-bootstrap3 theme.
Currently I use save_as to set the article which should be the current landing page.
When I do that Facebook throws an error because the canonical url isn't there.
So if the normal URL would be https://some.site/my_page.html but the save_as yields https://some.site/index.html
My .rst file meta
:save_as: index.html
The header contains.
<head>
<title>My Page</title>
<!-- Using the latest rendering mode for IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="/my_page.html">
<meta name="author" content="me" />
<meta name="keywords" content="my_page" />
<meta name="description" content="Stuff" />
<meta property="og:site_name" content="Stuff" />
<meta property="og:type" content="article"/>
<meta property="og:title" content="my_pagee"/>
<meta property="og:url" content="/my_page.html"/>
<meta property="og:description" content="Stuff"/>
<meta property="article:published_time" content="2020-03-20" />
<meta property="article:section" content="covid-19" />
<meta property="article:tag" content="Stuff" />
<meta property="article:author" content="me" />
<!-- Bootstrap -->
<link rel="stylesheet" href="/theme/css/bootstrap.min.css" type="text/css"/>
<link href="/theme/css/font-awesome.min.css" rel="stylesheet">
<link href="/theme/css/pygments/native.css" rel="stylesheet">
<link rel="stylesheet" href="/theme/css/style.css" type="text/css"/>
<link href="/css/hpt.css" rel="stylesheet">
</head>
Ideally pelican would save the page to the "normal" URL and to the save_as, or change the canonical URL to be the save_as
You have to go to the template which has the og:url meta and set a jinja2 statement like this:
{% if page.save_as %}
<meta property="og:url" content="/{{ page.save_as }}"/>
{% else %}
<meta property="og:url" content="/{# the previous statement of the theme #}"/>
{% endif %}

CSS file not loading when using WAMP server

WAMP server loading index.html just fine but not loading any additional css style sheets and script files.
I've tried these
<link rel="stylesheet" href="wamp/www/AngularJS_Practice/css/style.css"/>
<link rel="stylesheet" href="/css/style.css"/>
<link rel="stylesheet" href="css/style.css"/>
edit
My current index.html page is
<!DOCTYPE HTML>
<html lang='en'>
<head>
<title>Electronic Components</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<h2>Lorem Ipsum</h2>
</body>
</html>
edit 2
css
h2 {
color: orange;
font-style: italic;
}
Refresh your browser cache. Press 'Ctrl+F5'
That'll do the trick.
This worked for me:
<link rel="stylesheet" href=".\style.css">
You forgot to use type
<link rel="stylesheet" type="text/css" href="css/style.css">
Also note
<link ....> // this is right
<link ..../> // avoid this
Your HTML file seems right , try making this small css file in css folder and link to it
body{background-color:blue;}
Test this
I had a same issue and what worked for me is this
<link rel="stylesheet" type="text/css" href="./css/style.css">
Enjoy
select the full url from url bar and then press ENTER... It works! ;)

Glyphicons with Bootstrap won't show with <h:outputStylesheet> but with <link ...>

I think a lot of you know about twitter-bootstrap which makes it so easy to design "pretty" websites. I'm recently developing a JSF web application in Netbeans.
Everything except of the glyphicons.
In the header part of your website you will include bootstrap via
<h:outputStylesheet library="css" name="bootstrap.min.css"></h:outputStylesheet>
if you use jsf or
<link rel="stylesheet" type="text/css" href="resources/css/bootstrap.min.css"/>
if don't use jsf.
The weird think is that the glyphicons are empty squares like in this question:
Glyphicons rendering as empty box
I already checked with view-source with my browser and both rendered CSS have the same content.
<head id="j_idt2">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="resources/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="/WWHY/faces/javax.faces.resource/bootstrap.min.css?ln=css" />
<link type="text/css" rel="stylesheet" href="/WWHY/faces/javax.faces.resource/styles.css?ln=css" />
<title>WWHY IT Support Center</title>
<script src="resources/js/ie-emulation-modes-warning.js"></script>
</head>
Maybe you guys know why doesn't work for the glyphicons.
Thanks !
Most likely the same as with font-awesome. Check How to use Font Awesome from webjars.org with JSF
Although in th FA case there already was a jsf specific css

Dojo Calendar MatrixView

Trying to get this widget to render in a basic way.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<link rel="stylesheet" href="/eca/resources/dojox/calendar/themes/tundra/MatrixView.css">
<link rel="stylesheet" href="/eca/resources/dojox/grid/resources/tundraGrid.css">
<link rel="stylesheet" href="/eca/resources/dojox/calendar/themes/tundra/Calendar.css">
<link rel="stylesheet" href="/eca/resources/styles/app.css">
<link rel="stylesheet" href="/eca/resources/dojo/resources/dojo.css">
<link rel="stylesheet" href="/eca/resources/dijit/themes/dijit.css">
<link rel="stylesheet" href="/eca/resources/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" type="text/css" href="/eca/resources/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" type="text/css" media="screen" href="/eca/resources/styles/standard.css">
<link rel="SHORTCUT ICON" href="/eca/resources/images/favicon.ico">
<script type="text/javascript">
<script src="/eca/resources/dojo/dojo.js" type="text/javascript">
<script src="/eca/resources/spring/Spring.js" type="text/javascript">
<script src="/eca/resources/spring/Spring-Dojo.js" type="text/javascript">
<script language="JavaScript" type="text/javascript">
....
matrixView = new MatrixView({
style: "position:relative;width:900px;height:600px;"
}, "courseInstanceCalendar");
....
I have excluded dojo code before and after for simplicity.
What I'm getting now is only rows with week number and columns with day name like the screenshot but no grid with date values like this example.
Any idea what's missing?
Removing this style fixed the problem:
<link rel="stylesheet" type="text/css" media="screen" href="/eca/resources/styles/standard.css">
So now I have a calendar that looks like the example.
The lesson learned I guess is when you have rendering problems like this always check clashing styles.