How to create error free CSS/XHTML joomla - joomla

What is error free CSS/XHTML in joomla templates? I see that all the time, but I am not sure if that means the 404 page or not and how can I create one?

I think in this content this would be referring to 'valid' CSS and HTML.
You can validate CSS here:
https://jigsaw.w3.org/css-validator/
And HTML here:
https://validator.w3.org/
For the second part of the question creating an error document, you can add 'error.php' to the root of your template folder. This template file will be loaded instead of index.php if there is a 404, etc error. Have a look at default 'protostar' for an example of the implementation. For more information refer to: https://docs.joomla.org/Custom_error_pages

Related

What's the best approach to have a custom 404 page with October CMS with Laravel 5

I'm working on a project based on the October CMS, with Laravel 5.0.35.
I'm trying to override the 404 page.
The current 404 page is located here:
modules\cms\views\404.php
... and is served by:
modules\cms\classes\Controller.php
As you can see, both the controller and the view are inside modules. This folder is a dependency folder and its content should not be altered. The best approach I see here is to use an override.
You can see the October CMS structure here:
https://github.com/octobercms/october
Do you have any ideas or suggestions on how to achieve this?
Thanks.
'If the theme contains a page with the URL /404 it is displayed when the system can't find a requested page.'
http://octobercms.com/docs/cms/pages#404-page
Essentially just create a page withe the URL /404 and it will use this by default. The same can be done for an error (500) page, just use /error.

magento 2 custom phtml page

Having just got myself acquainted (enough) with Magento 1.9, and able to make the customisations required, I've been told that once it's out, we're moving to Magento v2.0.
Having found the differences in the file structure, I believe I can see where to place my code for the custom pages we use, but how can I add this page from my project to a static block for later use?
Previously, the method used was as follows (I realise this may not follow the best practise, but it worked):
Create element folder within theme or core templates directory.
eg. /app/design/frontend/<theme>/default/template/myelement/mypage.phtml
Add this page/element to a static block using the following in the content editor:
{{block type="<theme>/default" template="myelement/mypage.phtml"}}
This block can then be added to the category pages as required.
In Magento 2, I have tried what I believe to be required, which is replicating the file structure and adding phtml files to this, so the template file now resides in:
/app/code/<supplier>/<module>/view/frontend/templates/mypage.phtml
Adding to the content editor the following:
{{block type="<supplier>/<module>" template="mypage.phtml"}}
Unfortunately, this does not display the intended page (element). It doesn't display the calling "{{block" entry either, which usually happens when the line is invalid, so I can only assume that I'm missing something with the link to this template.
If anyone can offer some assistance with this, I would be most grateful.
EDIT:
Continued research on this has led me to the following assumptions:
Magento 2 requires more than just a new .phtml page, even for simple customizations.
I'm still missing something.....
Having gone through 3 different tutorials on creating new modules for Magento 2, each providing slightly different methods, but fundamentally being the same thing, I now have what I believe should be all the code elements to make a new .phtml template for display in a static block.
This has led to an additional problem though.
While I have the required code, I cannot add the module. Adding the module to etc/config.php, as suggested in 2 out of the 3 tutorials, simply crashed M2, both admin and frontend when you try to clear the cache. This is the case after manually clearing cache folders in the var directory.
Also, still unable to add the .phtml template file to a static block or page using content editor.
Not much hair left to pull out here, so looking for help! Thanks in advance
There are a few samples on GitHub, including https://github.com/magento/magento2-samples/tree/master/sample-module-newpage which shows a module adding a new page with a very simple PHTML template file. This example does not use CMS content editing however - it is a sample based on using layout files.
You mentioned you were getting crashes. Would need more details to help on that one. If you got it solved, could you update this question and accept a response to close it out? Thx!
You Should try "class" instead of "type". So your code should look like.
{{block class="<package>\<module>\Block\MyBlock" template="mypage.phtml"}}
You Should try "VenderName_Modulename::myelement/mypage.phtml" instead of "myelement/mypage.phtml". So your code should look like.
{{block class="VenderNameModulename\Block\MyBlock" template="VenderName_Modulename::myelement/mypage.phtml"}}

Opencart header and Footer Call in Codeigniter Site

I have a site in opencart on root and Codeigniter site in sub-directory.
Is there any way to call Opencart Header and Footer in Codeigniter site.
Thanks
Well it is possible to call it, you just have to call the tpl files, but variables used there will throw errors and finally it will not work, only if you had static elements only called in your header.tpl and footer.tpl would this work, in the other cases it will not(you would have to include manyy files, and security issues would come up).

How do I edit my Joomla login page?

I am having some hard times trying to figure out what file on my server is creating the page located at "http://www.website.com/component/users/?view=login" I don't have a component directory but I do have a components directory. I dove into that and checked out the com_users/views templates but I wasn't able to edit anything that reflected changes on the page in question really. One thing to note is that if I modify the view.html.php file at 'components/com_users/views/login' it seems to affect the page, and it seems to want to load the content on the page from the line of code that reads:
$menus = $app->getMenu();
Any idea of how to edit this page?
This is the file you will want to edit if you intend on making style or layout changes to the login page.
components/com_users/views/login/tmpl/default_login.php
...
The file that contains the functions for the login page and that I would not recommend editing is:
components/com_users/views/view.html.php
Thanks to GDP for providing the answer I was looking for:
"You may also want to check in the \html folder of your active template. if templates\yourtemplate\html\com_users exists, Joomla will be checking and loading from there if a matching view and file is found."

Custom error page in joomla?

I want to show a custom error page on Joomla for error messages like
Could not connect to database server
How can this be done ?
you can find joomla error page's template in /templates/system/error.php
You can copy this file to your template's root folder and edit it.

Resources