I am a WordPress dev and I've been asked add a new page to a Drupal site by a friend of mine. The version is 7.56.
This is a login page and its header/footer have to be different from the rest of the site.
I have the HTML/CSS code for the entire page and this has to be added in.
I have added the login forms and those are styled accordingly. Now how to I replace the header and footer?
If this was wordpress I'd create a new template file and remove calls to get_header() and get_footer(), how do I do the same with Drupal?
Create a file for your login page to customize it(put it in your theme directory). its template default name is page--user--login.tpl.php .( simpler solution is to duplicate page.tpl.php file, and rename it to page--user--login.tpl.php and customize markup)
then create two files
login-header.inc
login-footer.inc
put your markups there
then just include_once('login-header.inc') and include_once('login-footer.inc')
don't forget, clear the cache to it applied.
Related
I have wordpress and am using Elementor editor. I have added a page that is meant to be a template for each new pages. I added a block with breadcrumbs to this page. I want this page with breadcrumbs on evey new page that i create. Copying this page all the time creates problems, e.g. if I wanted to change something in this block so I must do this on every subpage. I do not know how to do it - all i want its one static page with that breadcrumbs that includes to every new page i create, and when im change something in this page, changes will appear on every page.
Help :( Photo below
https://i.stack.imgur.com/G1EyI.png
Use the "Template" block in Elementor
That is achievable with Elementor Pro using theme builder option.
Create that template as a single page template and then in display options choose to display it on all pages.
Creating a Single Page Template with Elementor Pro
Then you should use standard page editor or custom fields to put content that is then going to be rendered by the template.
Doing that will let you make changes on all pages at once by editing the template.
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
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.
how I can make master page in Joomla, I need that to be same in all the pages and the content part has to change it
I think master page of your wish would be the index.php page of your template.
Add your theme template by adding required joomla configuration, upload that template and make it as default site template.
You are ready to use it's index.php as your master page.
Add you can add your dynamic content in the same page.
I wish this will be useful to you.
I'm working on my first WordPress project. It won't be a blog but a CMS to quickly edit content and pages on the site.
I've got the header and footer exactly how I want it by editing them in the Appearance -> Editor menu. Under this menu I see quite a few templates that I could use (screen shot http://i.stack.imgur.com/P7IyY.png), some of which I don't even think I'll need or know where they came from. However when I edit my pages and go to the Page Attributes section there is only an option for 1 template (screenshot http://i.stack.imgur.com/UblzD.png). If I select Default Template as my template for the page, only the header and footer seem to load.
I am pretty new to WordPress. Am I suppose to 'activate' these templates somewhere? I only plan to use a handful of them (index pages, contact pages with a sidebar). What am I missing?
Thank you!
You should take a look at the information posted in the WordPress Codex on template files and the like. This image is particularly helpful in getting an understanding for when certain files are used by the WordPress engine to render pages WordPress Template Files Diagram.
You'll find the rest of the information relating to that diagram on this page.
I experienced this issue when using a child theme. I added a new template file to the child theme but the "templates" dropdown did not show on the page options section of any of my pages. I checked and double-checked the formatting of the template file and that was not the issue.
It turns out that my styles.css document in the child theme was not formatted properly and was missing the "template" attribute that designates the parent theme being extended with the child theme. I update the child theme css document to reference the parent template and voila! The template dropdown showed as expected.