{"id":1655453,"date":"2020-06-14T11:03:48","date_gmt":"2020-06-14T11:03:48","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1655453"},"modified":"2020-09-18T07:37:30","modified_gmt":"2020-09-18T07:37:30","slug":"allow-users-to-manage-their-items","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/de\/course-lesson\/allow-users-to-manage-their-items\/","title":{"rendered":"Allow users to manage their items"},"content":{"rendered":"\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"3e1d2592ce20bdf2bf813c9dfa44c991\"><p><span>First, make sure that you&#8217;ve <a href=\"https:\/\/toolset.com\/de\/course-lesson\/creating-a-my-account-page\/\">created a &#8220;My Account&#8221; page<\/a>. To this page, we&#8217;ll add a list of &#8220;my content&#8221;, with links to edit and delete items belonging to the logged-in user.<\/span><\/p><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"755dbab44b057b66b5063bb180f663e3\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/06\/toolset-account-page-allow-managing-own-items.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/06\/toolset-account-page-allow-managing-own-items-500x281.png\" alt=\"\" class=\"wp-image-1661911\"\/><\/a><div class=\"tb-image-caption\"><figcaption>&#8220;My Account&#8221; page that lists the items of the currently logged-in user<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p>There are three main steps to follow to add such list to a &#8220;My Account&#8221; page:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a <a href=\"https:\/\/toolset.com\/glossary\/view\/\">View<\/a> that lists the items of the currently logged-in user.<\/li><li>Create a Toolset <strong>form for editing these items<\/strong>.<\/li><li>Add the links to <strong>edit<\/strong> and <strong>delete<\/strong> items, to the View.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Create a View that lists the item of the currently logged-in user<\/h2>\n\n\n\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"3e1d2592ce20bdf2bf813c9dfa44c991\"><p>Start by <a href=\"https:\/\/toolset.com\/de\/course-lesson\/creating-a-view\/\">creating a simple View<\/a>. Then, use the <strong>Query Filter<\/strong> to select only the posts created by the currently logged-in user.<\/p><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li>Edit the &#8220;My Account&#8221; page and insert the <strong>View <\/strong>block.<\/li><li>Create a new View, select the type of content you want to list, and design its output.<\/li><li>Click to select the main <strong>View <\/strong>block and in the right sidebar, expand the <strong>Content Selection<\/strong> section. and <strong>Query Filter<\/strong> section.<\/li><li>Click the <strong>Add a filter <\/strong>button in the <strong>Query Filter <\/strong>subsection.<\/li><li>In the dialog that appears, select to filter by <strong>Post author<\/strong> and click <strong>Add query filter<\/strong>.<\/li><li>In the right sidebar, make sure that the <strong>Post author is the same as the logged in user <\/strong>option is selected and click <strong>Save<\/strong>.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Create a Toolset form for editing the items<\/h2>\n\n\n\n<p>Now, you need to create a Toolset form and a template for editing the items users can submit. You&#8217;ll create the form outside of the &#8220;My Account&#8221; page via the <strong>Toolset<\/strong> \u2192 <strong>Post Forms<\/strong> menu.<\/p>\n\n\n\n<p>For detailed steps, check out the lesson about <a href=\"https:\/\/toolset.com\/de\/course-lesson\/front-end-forms-for-editing-content\/\">front-end forms for editing content<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add the links to edit and delete items<\/h2>\n\n\n\n<p>Finally, you can edit the View you created in the first step and add links to edit or delete the items.<\/p>\n\n\n\n<p>Steps for adding a link to edit listed posts:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Insert the <strong>Fields and text <\/strong>block.<\/li><li>Click the <strong>Add Form <\/strong>button and then click the <strong>Edit post link<\/strong>.<\/li><li>Select the Content Template you created for editing posts and click to insert the shortcode.<\/li><\/ol>\n\n\n\n<p>Steps for adding a link to delete listed posts:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Insert the <strong>Fields and text <\/strong>block.<\/li><li>Click the <strong>Add Form <\/strong>button and then click the <strong>Delete Post <\/strong>link.<\/li><li>If needed, select the additional options for the delete link and click to insert the shortcode.<\/li><\/ol>\n\n\n\n<p>That&#8217;s it! The &#8220;My Account&#8221; page now lists all posts of the currently logged-in users and provide them with links to edit or delete their own items.<\/p>\n","protected":false},"author":4341,"featured_media":1661951,"template":"","related-lesson":[8431,8429],"class_list":["post-1655453","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-access-control","related-lesson-post-forms"],"_links":{"self":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1655453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":3,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1655453\/revisions"}],"predecessor-version":[{"id":1781119,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1655453\/revisions\/1781119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media\/1661951"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media?parent=1655453"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/related-lesson?post=1655453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}