Jump to content

beto

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by beto

  1. I can't add a new value to a custom PageArray field  for my user.

    Quote
    
    $current_user = $users->get(3085);
    $current_user->setOutputFormatting(false); 
    $current_user->galerias->add('2075') ;
    $current_user->save();
    

     

    However, when I create a new user, I CAN add the new PageArray value:

    Quote
    
    $new_user = new User();
    $new_user->name = 'user_2017';
    $new_user->galerias->add('2075');
    $new_user->save():
    

     

    I need help. Thank you very much.

     

  2. Hi all,

    I have a blog setup in PW like this

    /blog/

    cat1/

    article1

    article2

    cat2/

    article3

    article4

    Here is what I want.

    I want to have all articles at the URL

    /blog/article/

    instead of

    /blog/cat/article/

    Joshua, couldn't you have resolved this using segments?

  3. I wonder how different people handles different "file structures" for templates.

    I know that you can only put php code inside a template files, and i have thought that when you have to create a lot of unique "pages" with different php code it will take time to create a template file for each page.

    Not only that, but eventually, if you create a lot of templates, the templates folder would get very crowded. I was looking for a better way to organize my php files and found this solution. Instead of creating a template for each unique page with custom php code, I just create a single template named "include". This template just has two fields: title and include_path.

    The code of this template is just: <?php include $page->include_path; ?>

    In the "include_path" field I set the relative path for including other php files, and this method gives me a more organized collection of php files nested in various folders.

    For example, for a form called "reservation", I would just create a page with the template "include", and the field "include_path" set to "./php/forms/reservation.php".

    An example of this file structure:

    site/

    --templates/

    -----/styles

    -----/scripts

    -----/php

    --------/forms

    --------/processes

    --------/catalogs

    --------/galleries

    -----head.inc

    -----foot.inc

    -----home.php

    -----blog-post.php

    -----include.php

    Do anyone know if there is a better way to handle php files? o anybody would share their file structure approach?

    • Like 1
  4. Congratulations Ryan, you really do very cool work. Your new Form Buider looks fantastic.

    Anyway I will wait for the Form Builder to save entries to pages.

    Right now the builder is a great way to save information, but when the builder saves info to pages, then we'll have a very powerful tool to develop web applications.

    Cheers.

  5. Hello, I am new to this intriguing dimension called ProcessWire.

    I am doing my first steps, but I also get this message:

    Unable to move uploaded file to: /var/www/vhosts/showled.tv/httpdocs/site/assets/files/5874/20110707_164442-1.jpg

    I am running the site in Windows-Apache-PHP5.3

    Any help?

    • Like 1
×
×
  • Create New...