Chunks not saving self-closing tags. Any way to fix? - modx

I've set up a brand new site on 2.6.5.
As per my usual practice, I set up a head chunk. However I noticed it was not saving. On experimentation I see that it is not saving self-closing tags.
For example
<head>
<title>My test page</title>
</head>
Saves fine.
<head>
<base href="[[++site_url]]">
<title>My test page</title>
</head>
Will not save.
There are no errors. I have manually cleared the cache.
I have also tried:
<base href="[[++site_url]]" />
and I have tried using both a mark up plugin (Ace) and without.
Would anyone know what's going on here?

Usually it is because of mod_security. Kindly check with hosting support.
Another resource to consult, it is for MODX Revolution but server side situation would be similar and gives you clues: https://docs.modx.com/revolution/2.x/getting-started/installation/basic-installation/installation-on-a-server-running-modsecurity

Related

Single page with Astro and Netlify CMS

I’m trying to create a Single page with astro and netlify cms, in which the admin should be able to add/remove/modify the page through /admin, but I’m struggling with the understanding of the folder structure.
So, as far as I know, I need to specify the collection structure in the config.yml file. Something like this. (see attached file)
Which will create a content.md file. Basically it will contain all the info that was created through /admin.
The problem is that I don’t know how and where this content.md file is used. Should I import it manually in the index.astro file or am I wrong?
Thank you in advance 🙂
If you have a Markdown file at src/content/content.md, you will need to import and render it somewhere. It depends which page you want to display this content on, but if you want to show the content on your homepage, this would be src/pages/index.astro.
Here’s an example:
---
// src/pages/index.astro
import { Content, frontmatter } from '../content/content.md';
---
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My homepage</title>
</head>
<body>
<h1>{frontmatter.title}</h1>
<article>
<Content /> <!-- this will render your Markdown body -->
</article>
</body>
</html>
The key things to note here are:
The use of the <Content /> component to render the main Markdown content of your Markdown file
The use of an expression {frontmatter.title} to access the title field from your Netlify CMS config. Other fields would be available in the same way: {frontmatter.description}, {frontmatter.heroImage} etc.

Is there anyway to make web app's components do not look so small on mobile

I've made a website. It looks nice when using PC, but not good when using smartphone (Too small). Is there anyway to fix that?
Here is my website: https://hai-weather-forecast.herokuapp.com/
Did you try to add the responsive meta tag in the head element?
<head>
...
<meta name="viewport" content="width=device-width">
...
</head>
Here is the background docs
I tested by open the url you provided, setting the same device size with developer tools, and adding that meta tag in the head element editing the html by hand.
Beffore adding meta tag
After adding meta tag
Cheers!

place external JavaScript after CSS file inside head element using JSF 2.3

I use JSF 2.3 for developing web application.
As a web developer, I care about the performance of loading speed of a site.
As I was exploring on how I could make my site faster, I encountered this post on Stack Overflow. And the quote from the accepted and most up-voted answer said
stylesheets should always be specified in the head of a document for better performance, it's important, where possible, that any external JS files that must be included in the head (such as those that write to the document) follow the stylesheets, to prevent delays in download time.
I know that JavaScript performs better when it is placed at the bottom of the <body>, but I want to include reCAPTCHA and Google instructs us to place the required external JavaScript before the closing </head> tag.
So, I decided to include the required external JavaScript before the closing </head> tag and after CSS files to boost the performance.
However, my CSS files are declared in a JSF way like <h:outputStylesheet name="css/default.css"/>, and I realized that the CSS files declared this way are always placed after files that are declared in a non-JSF way, which is <script src="https://www.google.com/recaptcha/api.js"></script>. I also considered making the external JavaScript behave in a JSF way by changing <script> to <h:outputScript>, but the <h:outputScript> can only render local scripts as described in this post .
So, the result will always be as follows.
<head>
<script src="https://www.google.com/recaptcha/api.js"></script>
<link type="text/css" rel="stylesheet" href="/project/javax.faces.resource/css/default.css.xhtml" />
</head>
insted of
<head>
<link type="text/css" rel="stylesheet" href="/project/javax.faces.resource/css/default.css.xhtml" />
<script src="https://www.google.com/recaptcha/api.js"></script>
</head>
Maybe I'm thinking too much, and the placement order of link and script doesn't affect the performance that much, but if the loading speed gets faster even a little, I want to follow the better way.

Thumbnail with the like button in my website

I used the iframe to add the like button to my website
and after read many questions/answer related with my issue I add to the HEAD:
<meta property="og:image"
<meta property="og:title" content="EL SUR TAMBIEN ES AMERICA"/>
<meta property="og:url" content="http://elsuresamerica.weebly.COM/"/>
<meta property="og:type" content="website" />
I debugged it and get:
"More Than One OG URL Specified:
Object at URL (my web site) of type 'website' is invalid because it specifies multiple 'og:url' values: (my web site), (my web site)"
I don't understand what that means. I am not a developer, just a writer and I'm getting crazy with this. Please I need help to show a thumbnail in FB when the like button is clicked.
Thanks!
If that is the original code, I'd first see if it is because the 1st meta tag is not closed ;-) Try adding /> to the end of the 1st line

Google Plus not reading from meta tags

Below are the meta tags I am using for Google plus
<html itemscope itemtype="http://schema.org/Watch Movies Online">
<meta itemprop="name" content="Watch Movies"/>
<meta itemprop="description" content="Watch Movies Online">
<meta itemprop="image" content="https://www22.verizon.com/images/biglogo.gif" />
I see them in view source of the page. when I actually click G+ button, it is not reading the values from here. Not able to figure out what I am missing.. Pls suggest me...
The itemtype that you've specified does not appear to be a valid one. Please note that you can only use types specified by schema.org. Please change the type to a valid one and try again.
Apart from that, it would be good if you can specify the URL of your site where it's not working. Furthermore, you can use the Google Rich Snippets testing tool to test your site. This might help tracking down the problem you're having.
You have to add the following snippet at the top of the document or add to your definition:
<html itemscope itemtype="http://schema.org/**yourschematypegoeshere**">
Where you replace "yourschematypegoeshere" with one of these, http://schema.org/docs/full.html.

Resources