webhoes Posted July 12, 2018 Share Posted July 12, 2018 I have a page my classifieds that allows for adding a new classified. All is done with API because user are not allowed acces to the admin. User also don't have page edit rights. The new classified has template classified and is a child of classifieds. These are visible to the frontend. Can use another template like classified edit to let user edit their classified. I was thinking about a edit button/link on the my classifieds page per classified who are presented there in a list. Can this be done? And if so, how? Link to comment Share on other sites More sharing options...
dragan Posted July 12, 2018 Share Posted July 12, 2018 What's the reason for this strange sounding setup? So you want users to be able to create and edit pages, but not via the default template, and without the necessary rights? Why? Are you trying to create some sort of review workflow, i.e. the admin has to approve the classified first, and only he can then publish it? If that's the idea, you could simply work with page status: Only the admin can publish a new classified. (kinda like user-comments have to be reviewed and approved by someone, before it's published) Link to comment Share on other sites More sharing options...
webhoes Posted July 12, 2018 Author Share Posted July 12, 2018 User are not allowed to the admin because they can see privat information of others. The classifieds part is an extra feature to the site. That is why all pages are done via the api and they can only see their own content. I have created seconday admin for that. It looks like this. All entered classified of that user are placed under the submit form for a new classified. All is working except editing a classified and adding an image. That is why I am thinking a editing the classified through another template. I tried putting all entered classifieds in a forms, but could not get this working with images and making sure the right page gets updated. Link to comment Share on other sites More sharing options...
Macrura Posted July 12, 2018 Share Posted July 12, 2018 not sure if this helps, but there is a little known trick you can do where you can change the active fieldgroup of any template at runtime... I'm using this a bit in situations where i want to use a single template for something, but i want to be able to change stuff about the the layout, field descriptions, visibility, collapsed status and so forth, based on the value of a field; but it could be done based on other parameters/conditions.. Link to comment Share on other sites More sharing options...
webhoes Posted July 12, 2018 Author Share Posted July 12, 2018 thanks @Macrura, that is not what I am looking right now. However if this site works and might want to add more types of animals all with specific fields, then this would come in handy. Link to comment Share on other sites More sharing options...
tpr Posted July 12, 2018 Share Posted July 12, 2018 Perhaps you could consider this module: https://modules.processwire.com/modules/admin-restrict-branch/ Link to comment Share on other sites More sharing options...
webhoes Posted July 12, 2018 Author Share Posted July 12, 2018 I did. But for them to change their own page they need page-edit rights. When they see the page tree that also means they can see and edit pages of other users. Also hooking into the page output is not good practice (read here on the forum). Link to comment Share on other sites More sharing options...
tpr Posted July 12, 2018 Share Posted July 12, 2018 No, they can see their own pages only (and child pages). Perhaps it's configurable? Link to comment Share on other sites More sharing options...
Gideon So Posted July 13, 2018 Share Posted July 13, 2018 On 7/12/2018 at 8:25 PM, webhoes said: I did. But for them to change their own page they need page-edit rights. When they see the page tree that also means they can see and edit pages of other users. Also hooking into the page output is not good practice (read here on the forum). Expand No. They can see but not edit the page that they are not allow to edit. In other words, users are limited to edited the branch that assign to them. On 7/12/2018 at 9:40 PM, tpr said: No, they can see their own pages only (and child pages). Perhaps it's configurable? Expand tpr is right. It is configurable. Gideon Link to comment Share on other sites More sharing options...
webhoes Posted July 13, 2018 Author Share Posted July 13, 2018 The same branch contains pages from different users. Tried that and because all users have page edit right, they could edit other pages. I think I found the solutions with an alternative template. I created a my-classifieds-edit template and made it a child of my-classifieds. I made one page with it and called it edit. A user can now call that page through a edit link like /my-classifieds/edit/?id=xxx There is only one strange thing. When I ouput the description on the edit page, I see the <p> and <br> tags. And after a save these are visible in the frontend. Something that doesn't happen when creating the page the first time. Link to comment Share on other sites More sharing options...
Pip Posted July 20, 2020 Share Posted July 20, 2020 On 7/13/2018 at 10:05 PM, webhoes said: The same branch contains pages from different users. Tried that and because all users have page edit right, they could edit other pages. I think I found the solutions with an alternative template. I created a my-classifieds-edit template and made it a child of my-classifieds. I made one page with it and called it edit. A user can now call that page through a edit link like /my-classifieds/edit/?id=xxx There is only one strange thing. When I ouput the description on the edit page, I see the <p> and <br> tags. And after a save these are visible in the frontend. Something that doesn't happen when creating the page the first time. Expand Just wondering. How did you resolve this? Link to comment Share on other sites More sharing options...
webhoes Posted August 8, 2020 Author Share Posted August 8, 2020 On 7/20/2020 at 5:14 PM, Pip said: Just wondering. How did you resolve this? Expand I made those pages forms that could be updated and after update pull the data from the fields. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now