Jump to content

Pip

Members
  • Posts

    85
  • Joined

  • Last visited

Posts posted by Pip

  1. Hi everyone, 

    Is there a way for us to replicate the "http://mydomain.com/processwire/page/edit/?id=xxx" and change the template to match my site template? 

    I'm terribly happy with the admin / backend page edit. It covers literaly everything I want to empower my non super admin user in updating pages such as validation, repeater management, file upload. 

    I wish not to allow the users to see the backend for both security and aesthetic reasons. 

    Thanks and hope to hear from you soon. 

     

  2. On 7/14/2018 at 6:05 AM, 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.

     

    Just wondering. How did you resolve this? 

  3. Hi there. 

    Trying to visualize what you're trying to do.

    From what I see, it may be good to go with Page references. Multiple type. So you can tag them accordingly. 

    This way if you add a new catalog category, it will automatically be visible on the auto fill/checkbox. 

  4. On 3/30/2020 at 9:46 PM, benbyf said:

    Hi, Looking to create form elements on a page–some input with a colection of form inputs and the appropriate labels and variables for that input. I've used ProForms in the past and rolled out my own when creating simply one off forms, but I wonder if anyone has found a good way of allowing form creation on page editing so that clients can adhocly make and edit forms?

    Thanks

    @benbyf Actually wondering on this myself. I fell in love with Processwire because it was easy to organize the data and fields. But when it comes to giving users a different place (other than the ProcessWire platform itself), I'm at a limbo. Not a pro-programmer neither ProcessWire. 

    Any leads would be helpful. 

     

    • Like 1
  5. Hi everyone, 

    I'm trying to work on automatically creating a page when a user signs up. 

    Thing is the page created will be automatically assigned to them as the creator. How do I assign it to a different user? 

    Been testing out various codes but it still wont work. Any idea? 

    $memberpage = wire('pages')->add("blank", "/member/", ['title' => $user->name, 'name' => $user->name ]);
    						$memberpage->set("createdUser", wire("users")->get("bobot"));
    						$memberpage->save(); 

    bobot is my user where I would like to set the page creator as. 

    Sorry. Totally new on this. 

    Thank in advance. 

  6. Hi everyone!

    I'm trying out the Login/Register module for my site. Noted that the module assigns the newly registered user to login-register role. 

    Once you modify the login-register role's permissions, particularly adding page-edit, the new member role will be set to guest. 

    Thing is I'd like to grant my new users the power to create their own pages. Any advice? 

    Thanks. 

  7. Hi all, 

    I'm tweaking the Login/Register module to enable to automatically create a page for the User Profile. 

    See code below: 

    				if($input->get('register_created')) {
    					$this->message($this->_('Thank you, your account is confirmed and you are now logged in'));
    										
    				
    					$page = $pages->add("blank", "/member/", [
    					  'title' => '%s',
    					  'name' => '%s'
    					]);
    				}

    Upon completing the confirmation, I get this error: 

    
    Notice
    : Undefined variable: pages in
    D:\XAMPP\htdocs\food\site\modules\LoginRegister\LoginRegister.module
    on line
    281
    
    
    Fatal error
    : Uncaught Error: Call to a member function add() on null in D:\XAMPP\htdocs\food\site\modules\LoginRegister\LoginRegister.module:281 Stack trace: #0 D:\XAMPP\htdocs\food\wire\core\Wire.php(380): ProcessWire\LoginRegister->___execute() #1 D:\XAMPP\htdocs\food\wire\core\WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #2 D:\XAMPP\htdocs\food\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\LoginRegister), 'execute', Array) #3 D:\XAMPP\htdocs\food\site\assets\cache\FileCompiler\site\templates\access.php(11): ProcessWire\Wire->__call('execute', Array) #4 D:\XAMPP\htdocs\food\wire\core\TemplateFile.php(287): require('D:\\XAMPP\\htdocs...') #5 D:\XAMPP\htdocs\food\wire\core\Wire.php(380): ProcessWire\TemplateFile->___render() #6 D:\XAMPP\htdocs\food\wire\core\WireHooks.php(823): ProcessWire\Wire->_callMethod('___render', Array) #7 D:\XAMPP\htdocs\food\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #8 D:\XAMP in
    D:\XAMPP\htdocs\food\site\modules\LoginRegister\LoginRegister.module
    on line
    281
    
    Fatal Error: Uncaught Error: Call to a member function add() on null in D:\XAMPP\htdocs\food\site\modules\LoginRegister\LoginRegister.module:281
    Stack trace:
    #0 D:\XAMPP\htdocs\food\wire\core\Wire.php(380): ProcessWire\LoginRegister->___execute()
    #1 D:\XAMPP\htdocs\food\wire\core\WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array)
    #2 D:\XAMPP\htdocs\food\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\LoginRegister), 'execute', Array)
    #3 D:\XAMPP\htdocs\food\site\assets\cache\FileCompiler\site\templates\access.php(11): ProcessWire\Wire->__call('execute', Array)
    #4 D:\XAMPP\htdocs\food\wire\core\TemplateFile.php(287): require('D:\\XAMPP\\htdocs...')
    #5 D:\XAMPP\htdocs\food\wire\core\Wire.php(380): ProcessWire\TemplateFile->___render()
    #6 D:\XAMPP\htdocs\food\wire\core\WireHooks.php(823): ProcessWire\Wire->_callMethod('___render', Array)
    #7 D:\XAMPP\htdocs\food\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
    #8 D:\XAMP (line 281 of D:\XAMPP\htdocs\food\site\modules\LoginRegister\LoginRegister.module)
    
    This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged.

    I've cleared the cache but I'm still getting the error. ?

    Any ideas where I went wrong aside from editing the module?

    Thanks

  8. 3 hours ago, kongondo said:

    In that case you'll need to be able to track the user. Sessions work best for this (I think, better than cookies). From your description, it seems these are registered users. An example workflow:

    1. Vendor logs in.
    2. Verify, validate, etc that they are a vendor.
    3. If YES, create a session for them
    4. Then, use $session->redirect(/url/to/terms/of/usage/user1234) to redirect them to the TOCs.
    5. If they are not a vendor, $session->(/redirect/elsewhere/).
    6. Vendor completes the form. JS validation just to tell them if they forgot something
    7. Vendor agrees and POSTs form
    8. Form is posted to a page you have set up
    9. Inside the template file of that page, sanitize and validate form inputs
    10. If Errors, return back to the form
    11. No errors, $session->redirect(/fill-in-details/user1234)
    12. Vendor completes the form. JS validation to help them with stuff they might have forgotten to do
    13. Vendor POSTs form
    14. Form is posted to a page you have set up to receive completed details
    15. Sanitize and validate form
    16. Errors, redirect back to form
    17. No errors, use API to create a page for the vendor
    18. Errors creating page, tell vendor to try again (?)
    19. No errors, redirect vendor to some thank you page or wherever you want

    Use ProcessWire's CSRF for the forms.

    I might have skipped something.

    Thanks @kongondo! So that means I have to do a module to it? Still figuring out where to use API, Module etc.

    Will check out the CSRF for the forms. 

     

  9. Hi Everyone! 

    Need some guidance here. 

    I usually think of workflows but I'm kinda stuck where to go, what to search. 

    I am working on a website where vendors may create a posting (listing). When they click on say "Create" button, they go to a Terms of Use page where they have to agree. Once completed, they are redirected to a page where they can fill in the details. Details such as city where they are located becomes the parent of the page. 

    Kindly note: User is not a super admin. 

    Any leads is totally appreciated! 

    Thanks.

  10. Hi all!

    I just installed the MarkupSimpleNavigation. I'm trying to implement this code below:

                   <ul>
                            <li><a href="./index.html"><span>Home</span></a></li>
                       
                            <li class="active"><a href="#"><span>Pages <i class="fa fa-angle-down"></i></span></a>
                                <ul class="dropdown">
                                    <li><a href="./categories-list.html">Categories</a></li>
                                    <li><a href="./categories-grid.html">Categories grid</a></li>
                                    <li><a href="./typography.html">Typography</a></li>
                                    <li><a href="./details-post-default.html">Post default</a></li>
                                    <li><a href="./details-post-gallery.html">Post gallery</a></li>
                                    <li><a href="./details-post-review.html">Post review</a></li>
                                    <li><a href="./contact.html">Contact</a></li>
                                </ul>
                            </li>
                            <li><a href="#"><span>Reviews <i class="fa fa-angle-down"></i></span></a></li>
                            <li><a href="#"><span>Windows <i class="fa fa-angle-down"></i></span></a></li>
                            <li><a href="#"><span>Videos <i class="fa fa-angle-down"></i></span></a></li>
                        </ul>

    My problem is: The module has a way to add a class in the tag element li. But there seems to be no way to add in the <span> or the <i> in the list item. 

    Any advice? 

     

  11. Hi Everyone, 

    I'm working on a Page Reference field (Checkbox) for categorizing my food in my new site. 

    My list would be simple given on a straight one column line.

    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    But if I use the column settings of the page reference, it comes out like this

             1         2
             3         4
             5         6
             7         8 
             9         10 
     

    I wanted it to come out like so: 

             1         6
             2         7
             3         8
             4         9 
             5         10

    Any ideas on how I can manipulate so so my users can look at the list top to bottom, left to right? 

    Thanks in advance!

  12. 22 hours ago, Pixrael said:

    In the Items template you can use a Repeater field (Ingredients) with two or three fields: Ingredient (Page reference) + Quantity (Float) + Unit (Dropdown)  .. for ml, mg, oz, etc.

    Thanks for the response @Pixrael but I don't need quantities or measurements. Just the type of ingredient. The game itself doesn't stack the ingredients. To stick with how the game is representing the ingredient, we're trying to mention it twice. 

    Thanks. 

×
×
  • Create New...