Joomla HTML validation - html

I am trying to validate the home page of my Joomla. The issue is that I have the site on my local host so I can not simply copy the URL into http://validator.w3.org/ to validate.
My next thought was to open the index page in my browser and then run firebug to access the source code, and then copy and paste the code into the validator.
This seemed to work okay however when the code returns errors, I now don't know where to access the html to correct them.
Thoughts?

If you have not much knowledge about the way Joomla works, you will have to learn about the file locations.
Normaly, most changes should be done on the index.php file located in your template folder (root/templates/name_of_your_template/index.php)
If the changes you need to make aren't located in this file, you can have a look at the modules, component or plugin files that output these error and that becomes more serious.
If there is a template override for the module/component/plugin you need to modify, the files should be located in root/templates/name_of_your_template/html/name_of_the_module_component_or_plugin
If there is no template overide for the module/component/plugin that outputs the error, you will have to learn about template overrides.

Depending on your browser, there are many extensions that will validate non-accessible (i.e. localhost) pages
In Google Chrome - https://chrome.google.com/webstore/detail/html-validator/cgndfbhngibokieehnjhbjkkhbfmhojo?hl=en
Once it's installed, click on the icon and validate local page.

Related

Combined file HTML + CSS for opening in browser

I was wondering if there is a file format around where I can put (one or multiple) .css and (one or multiple) .html files, for example as a .zip (or similar) file AND your favourite browser can recognize it and opens it as a sort of static local "web page".
My use case would be to create html reports of some program execution, style it with a standardized css file and upload it on a cloud service, such that anyone with access can view it direcly in the browser.
I know a litte about html and css, but not enough to answer this question myself.
And "combine html and css" is not searchable on the web, so I'm asking you.
I'm not looking for a solution which bakes everything into one file.
I'm also not looking for an unzipped version of this (a folder), since that is not uploadable to most cloud storages I am aiming for.
Thank you.
AFAIK, there is no file format for that, but what you can do is create a folder in your htdocs or public folder and add all your .css and .html files in there. Then access it in localhost/yourfolder or if you are using a host http://yourdomain.com/yourfolder. For your HTML files to display the style correctly, they should be linked with the .css files or with the style inside each .html file between <style></style> tags in the <head> section.
You will see something like this, where you and others can preview and navigate through all HTML and CSS files.
Note: I've never done this on a host only on localhost, if you are using a host you will probably need to create permisions to access this folder, in that case contact your host so they can explain.

failed to load resource hexo.js

I'm using HexoJS to create a blog. I was able to generate the static files using hexo generate. Even though there are css files and JS files generated, they are not properly linked to the index.html.
So, I have to open each html page and correct each page links given in href and src attributes one by one. I believe that this is not very practical. Can anyone help ?
The localhost is used for preview the website. When we publish our blog, it should be on a server, then the path will be interpreted correctly, we don't need to change any thing. What we saw on http://localhost:4000 will be same when you published your website.
So, we don't have to worry about the broken paths in the public folder.

Sitecore and HTML files

We have a bunch of files (css, js, html, flash, swf, etc) put together by a third party to show videos on our site. This link is an example of the type of rendered output that i'm talking about - http://www.esi-intl.com/public/us/resources/virtualclassroom/presentation.htm. This isn't my company but I was able to find this via google since our site is not live yet.
Our editors would like to include these files in the Media Library and display these pages from there. I've tried to include these files but the HTML page doesn't render instead it is offered as a download. I've tried commenting out the Mime type in the Mimetype config file but I'm not having any luck.
Can the Sitecore media handler be modified to get these HTML files to render as pages?
Thanks
Html in media libary could.
To get the correct mime-type look at the setting name="Media.RequestExtension" set the value to "" then you get the original extension.
That makes things become easier for the web server to give the correct mime type.

Server side include no longer seems to be working - "[an error occurred while processing this directive]"

We have a page that has been using a server side include for many years. Recently it stopped working. No changes have been made to the page
<!--#include virtual="..\..\includes\nav.include" -->
Near the bottom of a page called contact.html
The 'nav.include' page simply contains html for a navigation bar. No javascript. No server side scripting. Just html.
Is there some setting somewhere that needs to be set to make SSIs work in the way it is implemented here (including a file with an uncommon extension inside a html file)?
A solution that I discovered yesterday:
I duplicated and renamed all my pages to .php (retained the original html files just in case!)
I have replaced all the {<#include virtual="folder_name/file_name.ext" -->} with
<?php include "folder_name/file_name.ext" ; ?>
with the appropriate number of dots and slashes depending upon where the pages are in my folder hierarchy. ( The {} above is to mark out the code only)
Finally, I renamed the original index.html to some other name so that the index.php is picked up instead of the index.html
This seems to be working out - I am still testing out all the pages and links - a very tedious and time consuming exercise!
INCLUDES SYNTAX:
In a php file use
<?php include "..//folder_name/file_name.ext" ; ?>
In an html file use
<!--#include virtual="../folder_name/file_name.ext" -->
EXPERIMENT WITH NUMBER OF "..." AND NUMBER OF "///" IN THE ABOVE SYNTAX TO GET THE CORRECT COMBINATION!!!!
For me, all my includes are small html files in a folder ABC which is directly under the webroot.
For pages which are under sibling folders of ABC i.e. in other folders directly under webroot, "..//" is the number of dots and slashes that work.
For pages which are directly in the webroot (i.e. not in any folder inside webroot), folder_name/file_name.ext without any dots or slashes has worked.
I haven't had the time to check out the number of dots and dashes required for any other level in the hierarchy!
I hope this helps!
Are you using GoDaddy? They did the same to my site, and I found on their forums someone that said to use include file instead of include virtual.
Just switched over to Godaddy servers and my SSI stopped working. I made a .txt file with the following:
AddHandler server-parsed .html
I uploaded it to the public html folder, then renamed it .htaccess, and everything started working.
I had too many files to convert all the extensions to PHP, so I had to find another answer, if at all possible.
For me, for a little while, exchanging include virtual to include file seemed to help, but then it broke again after a few days. I guess GoDaddy was not finishing monkeying around with the SSI configuration. o_O
The solution, as of tonight, was to convert all relative paths to absolute specification in regards to the site root. For example, I had to convert:
<!--#include virtual="..\..\includes\nav.html" -->
To:
<!--#include virtual="\includes\nav.html" -->
Using this approach, I was able to include HTML files inside other HTML files.
I discovered this on one of my pages that mixed absolute and relative path specification.
HTH
I've been seeing this problem frequently on my GoDaddy hosted site. I have to go into the Server configuration page, disable SSI, save the settings, then re-enable SSI and check "Use SSI on .HTM and .HTML files) and it starts working again.
The problem is on GoDaddy's side. For some reason, it's forgetting that it needs to parse SSI in files, until you turn off and turn on that option. Their Tier-2 support only suggested using Virtual instead of File on the Include command... which is preposterous, since not only does that not change a thing, the SSI includes work just fine most of the time... until it doesn't.
I'm also updating old .html pages to .php and replacing some of the with php include statements on all pages when some of the pages displayed [an error occurred while processing this directive].
The pages displaying the error also referenced an old .ssi file that wasn't even in the directory it pointed to. I deleted the old includes code to the non-existent .ssi file in those pages, and that fixed the error.
This error occurs when you have in your code html documentation like this
<!--#My awesome documentatacion-->
to fix it remove the #, like this
<!-- My awesome documentatacion-->

Usage of audio and video tag in Nitrogen

Still working on my personal web server, I was trying to use the html5 audio and video tags within Nitrogen.
As there is no #audio nor #video records, I decided to insert html text directly in the page generated by nitrogen, the result looks like this:
<audio controls preload="metadata"><source src="../../My Music/subdir/song.ogg" type="audio/ogg" /source>audio tags not supported</audio>
In my understanding this should work because the audio tag is supposed to be interpreted directly by the client browser, and there is not any nitrogen id or event observer in the code.
But when I browse this code from Firefox, I briefly see the control opening, and then the audio element simply disappears.
If I copy paste the whole code generated by nitrogen (display html source page, copy and paste in a file located at the origin of the nitrogen project) and open it with the browser, it works fine. The relative path is correct, assuming that the search stats in nitrogen project. I have tried absolute path also, without success.
I don't know
if it builds a file name of the form ".._.._My music_subdir_song.ogg" like nitrogen does for url analysis,
or if it uses another directory to start the path,
or if it simply doesn't work the way I am thinking.
...
Edit: some complementary information:
I have done the following changes:
create one directory including some ogg files in the site/static directory + move a static test.html file in the site/static. If I open directly test.html -> ok. if I redirect from my web site -> Not ok.
same test with a copy of the directory at the Nitrogen application root and access from my web site -> not ok
As the information on the web page is ambiguous, I modified test.html to access to a file that does not exist on my PC -> same behavior.
I think I'll use the debugger to understand how the request is managed, to be continued...
Edit 2:
using the debugger I can verify that the wf_core:run_catched() is called several times. The fist call is when it process the event in my page that redirect to the static file.
The second time to process the static html file itself.
A third time to process finish_static_request() with a Path equal to my_music/song.ogg, and then I get lost in the processing of the answer. Another wf_core:run_catched() was called in parallel, but I didn't follow it...
I have been able to verify that the file can be accessed: I have added several audio tag in the html files, and I was able to "download" the existing files using the DownloadHelper Firefox plugin.
My understanding now is that the path is correct (at least when I place the files in a subdirectory of site/static), the server is able to retrieve the files and send them, the browser recognize the audio and video tags, but the link between the embedded audio/video reader and the files is lost, although I have added a type definition inside the audio tag.
Any idea to continue?
Edit 3:
Finally I got it. As Chops suggest it I had to go in the inets server configuration, not to define the path, but to define the type association. I have added the following definitions in etc/inets_httpd.erlenv, and it works.
{mime_types, [
{"css", "text/css"},
...
{"ogg","audio/ogg"},
{"webm","video/webm"}
]}
:o)
Based on the contents of the url attribute ("../../My Music/subdir/song.ogg"), the problem, when it's served from Nitrogen is that the request (Assuming you're using the default 127.0.0.1:8000) for the audio will be to the url "http://127.0.0.1:8000/My Music/subdir/song.ogg"
What you want to to do, if you're using the standard Nitrogen installation, is to put the song files you want into the site/static directory, perhaps in "songs" subdirectory.
Then change the url attribute to be "/songs/mysong.ogg" (or whatever path within site/static you used).
Note: Dependinding on your server choice (Webmachine, for example), you may need to tinker with the server's specific config file to tell it to handle the new directory for static paths, for help, check the configuration docs on the Nitrogen site.
Beyond that, there's nothing special about outputting raw HTML in Nitrogen. It is my understanding that the problem here is really just related to the paths of the requests being sent to the server.