{"id":1622355,"date":"2020-05-13T14:26:43","date_gmt":"2020-05-13T14:26:43","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1622355"},"modified":"2021-03-01T11:47:01","modified_gmt":"2021-03-01T11:47:01","slug":"creating-a-my-account-page","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/es\/course-lesson\/creating-a-my-account-page\/","title":{"rendered":"Creating a &#8220;My Account&#8221; Page"},"content":{"rendered":"\n<p>This page operates in two modes depending on whether a visitor is logged-in or not.<\/p>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid tb-grid\" data-toolset-blocks-grid=\"3d9c399fe625e1b972f817a0680229f6\">\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\"><div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"cd10108f3cb93bb46f86216e9ef4140f\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-not-logged-in-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-not-logged-in-1-500x300.png\" alt=\"When a user is not logged in, the \u201cMy account\u201d page appears as a login page.\" class=\"wp-image-1555963\"\/><\/a><div class=\"tb-image-caption\"><figcaption>When a user is not logged in, the \u201cMy account\u201d page appears as a login page.<\/figcaption><\/div><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\"><div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"d2b38e5e80e333245b4c46d468d00a36\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-logged-in-3.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-logged-in-3-500x300.png\" alt=\"When logged-in, users see their account summary with links that allow them to manage their items and edit their profile\" class=\"wp-image-1555971\"\/><\/a><div class=\"tb-image-caption\"><figcaption>When logged-in, users see their account summary with links that allow them to manage their items and edit their profile<\/figcaption><\/div><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<p><strong>When a user is not logged in<\/strong>, the \u201cMy account\u201d page appears as a login page. We explain the setup of this in the lesson about <a href=\"https:\/\/toolset.com\/es\/course-lesson\/creating-custom-login-forms\/\">creating custom login forms<\/a>.<\/p>\n\n\n\n<p><strong>When a user is logged in<\/strong>, the \u201cMy Account\u201d page shows their account summary with links that allow managing their items and editing their profiles. This is what we explain on this page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Build the \u201cMy account\u201d page<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Navigate to&nbsp;<strong>Pages \u2192 Add new<\/strong>.<\/li><li>Give your page a name (e.g.,&nbsp;<strong>My account<\/strong>).<\/li><li>Click&nbsp;<strong>Save Draft<\/strong>.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"31ea0ee1abe2038e91b2af41312d4954\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-save-draft-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-save-draft-1-500x222.png\" alt=\"Save Draft for your page\" class=\"wp-image-1554777\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Saving the draft for My account page<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p>You can now design your page using the Block Editor.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"inserting-user-info-and-a-logout-link\">Insert user info and a logout link<\/h3>\n\n\n\n<p>In the first row of the first column, we will display the <strong>user\u2019s login name<\/strong>. In the second column, we will include the <strong>logout link<\/strong>.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Insert the <strong>Grid<\/strong> block with two columns.<\/li><li>In the first column insert the <strong>Fields and Text<\/strong> block.<\/li><li>Click the <strong>Add Field or View<\/strong> button.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"0085c74970a20f54844246d453877feb\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-field.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-field-500x235.png\" alt=\"\" class=\"wp-image-1555037\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Adding the field<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Click the <strong>User Login <\/strong>field.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"fba0aaf94c0f4b3b0ceae076e292c4e6\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-field-user-login.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-field-user-login-500x269.png\" alt=\"\" class=\"wp-image-1555047\"\/><\/a><div class=\"tb-image-caption\"><figcaption>User Login field<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>Select <strong>The current user or the one being displayed in a View loop<\/strong> option.<\/li><li>Click the <strong>Insert shortcode<\/strong> button.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"6cbc5d21bdb402da29a7a85de3ad2184\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-field-user-login-add-shortcode.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-field-user-login-add-shortcode-500x127.png\" alt=\"\" class=\"wp-image-1555059\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Adding the field shortdcode<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p>Your page should look like the following.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"55afb07da460b043337441ffe11bce0a\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-user-info-logout-link-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-user-info-logout-link-1-500x198.png\" alt=\"\" class=\"wp-image-1555171\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Displaying the user info on the frontend<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"adding-links-to-other-pages\">Add links to other pages<\/h3>\n\n\n\n<p>The \u201cMy Account\u201d page usually provides a set of&nbsp;links to other pages&nbsp;which users can use to view and edit resources that they own.<\/p>\n\n\n\n<p>Here are two examples of useful links to have on a &#8220;My Account&#8221; page:<\/p>\n\n\n\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"360284519b991feb492b582c7d84725f\"><ul><li><strong>\u201cEdit your profile\u201d<\/strong>: this will link to a page where the user can <a href=\"https:\/\/toolset.com\/es\/course-lesson\/using-forms-to-create-an-edit-your-profile-page\/\">edit their profile<\/a>.<\/li><li><strong>\u201cAdd a new gym\u201d<\/strong>: this will link to a page with a <a href=\"https:\/\/toolset.com\/es\/course-lesson\/front-end-forms-for-adding-content\/\">form for submitting new content<\/a>.<\/li><\/ul><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"96da258dbb8afc429895584d576c0641\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-links.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-links-500x300.png\" alt=\"\" class=\"wp-image-1555981\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Links to other pages<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p>The \u201cEdit your profile\u201d and \u201cAdd a new gym\u201d pages you yet have to create. For now, create text placeholders which you will link a little bit later.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"ab49dc00d874d4bf999c3cd16d3bbd73\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-link-placeholder.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/03\/account-page-add-link-placeholder-500x227.png\" alt=\"\" class=\"wp-image-1556227\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Adding the links to other pages<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Allow users to manage their items<\/h2>\n\n\n\n<p>If your site allows users to submit their own content, it&#8217;s great to also provide them with a convenient way to manage their items from the &#8220;My Account&#8221; page.<\/p>\n\n\n\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"3e1d2592ce20bdf2bf813c9dfa44c991\"><p>For detailed steps, check out the lesson about <a href=\"https:\/\/toolset.com\/es\/course-lesson\/allow-users-to-manage-their-items\/\">allowing users to manage their items<\/a>.<\/p><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"hiding-the-my-account-page-from-visitors\">Hide the \u201cMy Account\u201d page from visitors<\/h2>\n\n\n\n<p>The \u201cMy account\u201d page lists the information for the currently logged in user. It means that the content should be hidden from other visitors.<\/p>\n\n\n\n<p>It&#8217;s best to make the \u201cMy account\u201d page available only for logged-in user.<\/p>\n\n\n\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"360284519b991feb492b582c7d84725f\">You can find detailed steps for this in the lesson about <a href=\"https:\/\/toolset.com\/es\/course-lesson\/restricting-access-to-pages\/\">restricting access to pages<\/a>.<\/div>\n","protected":false},"author":4341,"featured_media":1629083,"template":"","related-lesson":[8431,8433],"class_list":["post-1622355","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-access-control","related-lesson-user-forms"],"_links":{"self":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson\/1622355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":3,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson\/1622355\/revisions"}],"predecessor-version":[{"id":1970549,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson\/1622355\/revisions\/1970549"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/media\/1629083"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/media?parent=1622355"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/related-lesson?post=1622355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}