I'm new to Drupal. I have a page template that has a nav, header and footer. This works correctly for how I want most of my site, except for the login page that I would like to completely customize.
Is there a way to overwrite or ignore the overall site templating (perhaps by placing my login page template into a folder within the /templates directory?) in order to style that one page differently?
Thanks.
If you are looking out for customizing only the login page without its effect on anywhere in the site, you can use page--user--login.tpl.php to override it.
Basically you should find system template you want to override. It may be part of standard drupal installation but also part of some module. Copy it to your theme's templates directory and change the way you like. Clear the cache and drupal will re-scan your theme and start using templates you added instead of original one.
Related
I am new in WordPress. In my WordPress application having one page named "Retail". I want to create new page named "Website" with the same content of "Retail" page. I copied content and paste in to new page editor and saved. But some CSS problem is there. I think css file is missing kind. How to resolve this problem?
We cannot find the problem without any real information. However you can check if any of the following issues occurs:
You use a theme which let you add custom CSS rules in specific page. You might have a settings button in the page where you add it. In that case, you need to copy that as well.
You need to check your CSS files and see if the styling rules are applied for a specific page. It could be like .page-id-662 or .pageid-662
The last you could check is the functions.php file in case you enqueue a styling CSS file on specific pages as well.
What did you do exactly?
Created a new page in the Wordpress backend and copied the contents of "Retail?
Or put on a whole new Wordpress website and copy the "Retail" page there?
And please give an example of what went wrong in the design. Can you possibly specify the HTML code of an element with a design error?
I am working on a drupal website that has a theme installed to it.
I would like to set the Front/Home page of the website to a .html.twig template I have in a custom module I am busy working on.
How would I go about doing this? I have done some googling and it likes like the answer lies somewhere with page--front.html.twig, but I am not sure where to go from here.
Inside my themeFolder/templates there are page--front.html.twig & page.html.twig
I have tried creating my own page--front.html.twig and storing it inside myModule/templates but this did not help me.
Also, how would I go about applying .html.twig templates to different regions of my website?
Any advice would be greatly appreciated
Enable debug and check which template is using in front page. To enable the debug go to sites/default/development.services.yml
You will need to locate core/modules/system/templates/page.html.twig file. This is a base page template that you can extend. Copy this file into your theme templates folder (Look for tpl or templates folder - it depends on the theme you are using). Rename this file to page--front.html.twig and finally flush caches for the change to take effect. This can be done by executing drush cr in your terminal or in the UI (admin/config/development/performance).
If you are planning to work on custom layout for your homepage I would suggest creating a dedicated content type (for example Landing page) and setting up your layout with the help of Paragraphs module. This would allow you to avoid hardcoding functionality in you template files.
I'm a WordPress developer who's been tasked to create a temporary one-pager to a Drupal site. The client would like to have a simple front page with a logo and 4 external links until their new site is ready. Normally I'd just make a simple index.html page with some CSS and call it a day. But in this case they need some of the sub-pages from the Drupal site to continue to work.
Had it been a WordPress site, I would have just created a new template file and a new page inside WordPress, and made that the front page. But as I have zero experience with Drupal, I don't know if you can do the same thing here.
What is the easiest (quickest) way to make a simple splash-page as the front page, while having the rest of the drupal site continue to work? The splash-page should ignore all CSS and JS from the original theme — preferably have a completely independant section fromt the rest of the site.
In Drupal 7 you have few "levels" of templates. First you have "most outer" template html.tpl.php It contains html head and it is usually common for all pages.
Then inside that html.tpl.php you'll include page.tpl.php. That one should again contain some common page elements, as header and footer, but again, if your design requires that, you can have more than one page template.
Page template will include node template. In drupal you have 2 basic content (node) types but you can create many more of them. Basically for every different page layout you can create new content type (but there also are lot of different ways to achieve the same thing).
Basically you should create new content type called i.e. "splash" (machine name!). Add fields to it if they need to be back-end editable.
Then you should create new template file for your content type. Name matters, so you should call it node--splash.tpl.php . You can find and copy to your theme existing node.tpl.php and change it to your needs.
Keep in mind that when ever you add/remove new template file you have to clear the cache so drupal would scan theme directory, notice and start using new templates.
And if you need also different page template for you page you'll have to put some code into you tamplate.php file:
https://www.digett.com/insights/overriding-page-templates-content-type-drupal-7
Drupal template engine design an specific file name for override front page.
You can create the file html--front.tpl.php, and this will be used only for the front page without touch any other page. You can page here your custom HTML and reference css/js.
If the page you need share common styles with the rest of the site, I would recommend to instead override page--front.tpl.php which is basically the content of the page without the tags
For more information here is a link https://www.drupal.org/docs/7/theming/howto/customize-the-front-page-template
where can i add a link to a custom css file in Joomla?
I have tried adding file in index.php but it is valid only for that template and if i load another template i lose the link.
I'm using Joomla 2.5.
The right place for a site-wide css should be the template index.php file. But since you plan to use several templates, the only other meaningful option is to add it in a system plugin event, instead of spelling out the code you will need to use
$document->addStyleSheet($cssurl)
However it will be more effective if you just insert it into all your templates. Also please note that system page cache may not run the events on cache hits.
I have been trying to figure this out now for a while but there but I haven't found any conclusive answer yet. I want to add some pages to wordpress that are static. I need to include JS script that is from a third-party login. Using JS, HTML, CSS. Very simple and basis login.
So normally what I do is create a page, empty, attach a template and put the JS/HTML/CSS/Text into that template.
However, it seems weird to create an empty page in a CMS. Is there another way, a proper way, of adding a normal page into wordpress without using the static PAGES option in the CMS?
You could just create the page and add a link to it from your WP-site. But this is only if you don't need any of the wp-functions. Also it won't show up at all in your wp-admin dashboard.