Jump to content

PCuser

Members
  • Posts

    29
  • Joined

  • Last visited

Posts posted by PCuser

  1. I'm trying to get a field value and sanitize it before outputting the value.

    In this case I want to retrieve the page title and then use it as the id for the container element (sanitizing to remove spaces/uppercase).

    Example (doesn't work): 

    <? foreach($pages->find("template=sportspage, sort=random") as $sportspage) :  ?>
    
    <div id="<?= $sanitizer->$sportspage->title; ?>">
    </div>
    
    <? endforeach; ?>

    I'm not that used to PHP and formatting particularly with foreach loops so the documentation isn't really helping. Thanks

  2. I tried using this module on a new website and it looks like it's no longer functioning, probably due to the Google Api issues.

    When I add a new Field I immediately get the error "Error geocoding address" and cannot update the address without getting this error, and it no longer returns the lat/lng points when I change the address.

  3. The module was working great...until it stopped working so great.

    Now when I hit 'Save' on the template (with "Rename on Save" is checked) the page clears the image fields on template that are targeted for renaming. The image fields are blank, 0kb images.

    I tried disabling the part of the module that was renaming the images and uploading at least went back to normal. Uninstalling and re-installing, the problem persists.

    The The HTML Entity Encoder was enabled on all the image fields, but the name of the last image that 'broke' the module for me was named something like "Artist-Name-------------Oil-on-Canvas------32-in-x-45-in-$1000.png" is that helps.

    My renaming convention for the images was just the page title:  img-{$page->title)

     

  4. I have the template: categories-template.php

    And the select multiple choice checkbox field:
     categoryoptions
    1 - red
    2 - blue
    3 - green

    And 3 pages (using the template categories-template.php)

    redpage (with the page id 1120 & the checkbox 'red' checked off on the field categoriesoptions)
    bluepage (with the page id 1130 &  the checkbox 'blue' checked off on the field categoriesoptions)
    greenpage (with the page id 1140 & the checkbox 'green' checked off on the field categoriesoptions)

    When I try to target the blue page with:

    <?php echo $pages->find("template=categories-template, artcategories=2"); ?>

    I receive the right page ID, in the above example it outputs the id '1130'.

    But

    <?php echo $pages->find("template=categories-template, artcategories=2")->url; ?>

    Doesn't get the page URL of bluepage, it just returns the URL of the current page that it is on.

    Any suggestions? I've been troubleshooting this longer than I'd like to admit lol. Thanks

  5. My page tree looks like this default Page List pagination set at 50 (Artist Name # used instead of actual names for this example):

    Home
                 Art
                        Artist Name 1
                        Artist Name 2
                        Artist Name 3
                        Artist Name 4
                        Artist Name 5
                        Artist Name 6
                        Artist Name 7
                        Artist Name 8
                        Artist Name 9
                        Artist Name 10

    ..................continued 

                        Artist Name 47
                        Artist Name 48
                        Artist Name 49
                        Artist Name 50
                        [MORE]

    When I hit [MORE], or go to Page 2, it simply duplicates Artist Name 50 instead of showing the next Artist Name 51

    I am using, Uikit Theme but this occurs on all the other themes as well.

    Even changing up the page tree layout settings within themes brings about this issue.

    Also, if you edit the 'Art' page (ie the parent page) and see all the Children pages, the issue still occurs.

    The only way I could find the page Artist Name 51 to edit it was to use the search function, and the page is working (shows up on the live site), the URL is correct, and I can echo out content from the page fields if I add content to page.

    Version ProcessWire 3.0.110 
    Installed 3 days ago, started site over when I had module issues, I believe it was an issue experienced prior to re-installing Processwire but wrote it off as a quirk, thought page Artist Name 50 showed it twice for reference but didn't think it was in place the missing Artist Name 51 page.

    I changed the limit to 100 before pagination, which is sufficient for my case, for now at least.

  6. I have this line of code on one of my templates:

    $field = $fields->get('artcategories');
    $all_options = $field->type->getOptions($field);
    $selected_option = $all_options->get('2');
    echo $selected_option->title

    The line highlighted in red throws the error
    Notice: Use of undefined constant  - assumed '' in /public_html/site/assets/cache/FileCompiler/site/templates/samplepage.php on line 45
     

    I looked into the issue and it's usually a lack of quotes, presumably it's the getOptions($field) requires quotes but with quotes the script won't work.

    Edit: I think one of the quotes what copied from elsewhere and was the wrong ansii character @ 
    $all_options->get('2');, i.e the wrong apostrophe, so it was throwing the syntax error.

  7. 34 minutes ago, wbmnfktr said:

    Are there any modules or hooks in place that could be responsible for that behaviour?

    How do you create those painting-pages?

    Which version of ProcessWire do you use?

    I just tried to reproduce that behaviour but without success.

    - Not that I'm aware, pretty standard stuff, nothing custom.
    - From the Page tree, hover over the artist, select 'New' and I create the child page. The issue starts from the moment the page is created.
    - The latest (dev) but this started months ago when I was on the latest production release.

    18 minutes ago, Robin S said:

    I've opened a GitHub issue for this: https://github.com/processwire/processwire-issues/issues/666

    Thanks, this issue really has been the devil for me to.

    • Like 1
  8. I'm working on a site where there are a number of artists selling paintings. Some are abstract and untitled pieces.

    The tree structure is pretty simple:

    Home
          - ART
                - Artist's Name
                       - Untitled 1
                       - Untitled 2
                       - Painting Name

    When I edit the contents of the page, say Untitled 1, and edit the fields, or just hit 'Save', the URL changes from /Untitled-1 to /Untitled-1-20 and increments ( /Untitled-1-21, /Untitled-1-22...) from there each save. I can change it back to /Untitled-1 manually, but it reverts each time also I make any changes to any of the fields.

    Is there a way to override this? It only happens with the Untitled # pages. Thank you

    • Like 1
  9. As someone who's been doing front-end web development for a while for me personally Processwire has been a breath of fresh air compared to Wordpress.

    Wordpress was better than nothing, but with ProcessWire I feel in control of my site and I can feel good knowing my code isn't bogged down by Themes, plugins and Wordpress updates. It's helped taken a lot of the fear away of Back-end programming since I can easily leverage PHP, for which my understanding is really limited, and create fields in the backend.

    I do what I can to put in a good word for ProcessWire when I tell people what I use to develop sites. It is pretty unknown to many here (Toronto, Canada) but it's been an invaluable service to me! I know there might be newer/trendier ways to build websites but I really like the Processwire Core, feels like I'm building my own Facebook with all the modules ?

    • Like 6
×
×
  • Create New...