GRAV - Custom form pages for login plugin - grav

I want full control of custom login, register, etc. pages in Grav. Default form plugin does not allow to do things such as two columns, etc.
I have been checking documentation for login plugin but it does not seem to be any example on how to provide a fully custom page for those forms.
Is there any place where an example is given?
For example, how a user_register form shall be prepared as a custom page or template to interact with login plugin?

The login plugin creates the login page from 3 template files. Simply putting the matching template files in your theme folder will override the template that comes in the plugin. In the plugin, you'll see the following files:
- templates /
- login.html.twig
- partials /
- messages.html.twig
- login-form.html.twig
login.html.twig inherits the base template and call messages.html.twig and login-form.html.twig.

Related

Should I create custom page template or use functions.php?

I'm using the Genesis framework for WordPress and the Business Pro theme.
I want to customise the contact page and if you view the URL below, you can see the Email and Telephone sections that I want to create next to the form.
My question is should I create custom page template or use functions.php to target the contact page using a conditional. I guess I'm trying to find out best practise or if one method is better than the other in this case.
It does not matter how you create a contact form and add it to the page.
You can use a contact form in a page template. It is easier to manage than managing one function in functions.php file having a lot of functions in it.
Another option - is if you use "Genesis framework", use it further.
Otherwise, the part of the site with the framework and other through the code via ftp...
Make a page with this framework, there create what you need.
It will be easier to maintaining a site in the future. Especially if you make a website for a client who is unfamiliar with development.
You could use the Genesis Simple sidebars plugin to create a custom sidebar which only displays on the contact page and populate that widget area with your email and telephone details.
No need for a template but if you want to, create a file named contact.php in your child theme folder and add the following code to the file :
<?php
// Template Name: Contact
genesis();
You can then select the Template named Contact from the Page Attributes box on the Edit Page screen,

WP: Can I use Template Hierarchy page and templates together or am I talking about same thing?

I'm trying to create WP site with different templates with different functionality but in same web page with same header and footer.
So my question is, Is Page Hierarchy (page-about.php) different than Template Hierarchy?
If its different thing, can i use both of them in same page?
Ex: templates/about.php + pages/about.php = about page with about template etc...
The template hierarchy boils down to how WordPress decides which template to load when a URL is requested (when you type a URL in your browser address bar). In your question above, you mention page-about.php - this is one of the many templates you might have in your theme folder. When someone requests the page example.com/about on your website, WordPress will load the page-about.php template because it is the best match according to the rules in template hierarchy.
For info on exactly how the template hierarchy 'matches' URLs to templates, see:
https://codex.wordpress.org/Template_Hierarchy

Set template for pages with a plugin

Im looking for a plugin which lets me choose templates for my pages.
Currently, what im doing is i manually open up the page for which i want to set a template and choose one for this single page. I then have to do this again for all the other pages one by one.
Is there a plugin which lists all my pages and lets me easily choose a template for these pages?
there is not such plugin because this feature is integrated in the wordpress core, http://img1.uploadscreenshot.com/images/orig/7/20222113055-orig.png

Main Page Login also logs user into Wordpress section

We have a site with a members-only section and WordPress in a subdirectory. Some of the members-only pages, forms, etc. are outside of WP. We created a Member Login form on our homepage using Dreamweaver 5.5. Is there a way to have WordPress accept that main login so that a member doesn't need to login again when going to a WP member-only page? Thanks for any help you can be in pointing me in the right direction. I know just enough PHP to be dangerous. Let me know if you would like to see the DW login code.
Yes, you are talking about creating your own custom template for a Wordpress page.
You can use the page you generated from Dreamweaver by renaming its extension to .php, unless it already is. Move it to the /wp-content/themes/yourtheme folder, where yourtheme is your currently active theme. On the top of the template, add these lines:
<?php
//
// Template Name: Login Form
//
?>
Go to Wordpress Dashboard > Pages > Add New. Add a page called 'Login' or whatever you need, select 'Login Form' as the Template under Page attributes, and you Publish.
Reference: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

Is it standard practice for plugins to add pages to wordpress using templates or shortcodes?

I want my plugin to add new pages to the website and I wanted to know which is the best way for doing that. I've seen plugins which add their pages using shortcodes and other plugins which include their own page templates.
I was wondering which is the better way of adding public pages (NOT AN ADMIN PAGE) to Wordpress?
both ways you described are valid . you can do both (by the way, shortcodes are just a different way to INCLUDE the template inside a post or page)
you did not specified what this template should do - but What I would do is include the template needed in the plugin folder structure, and then call it when needed , with $plugin_directory = plugin_basename(__FILE__);

Resources