Jump to content

heldercervantes

Members
  • Posts

    389
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by heldercervantes

  1. I'm having trouble with processInput vs InputfieldMapMarker. The result:

    Error: Call to a member function set() on null (line 177 of C:\xampp\htdocs\cars\site\modules\FieldtypeMapMarker\InputfieldMapMarker.module)
    

    Is there any way to set an exception for this variable not to go through processInput? Or perhaps another, better method to fix this?

  2. This is spooky. Just tried reinstalling the module, and no change. I had installed it today for the first time, so I was using the latest version.

    In my case I don't even get the submit button.

    Other tests I've made:

    • generating pages with other templates
    • by page instead of template
    • tried leaving incognito mode in chrome (I needed two logged users)
    • added superuser role
    • EDIT: tried array example from the documentation, discovered an extra ) near the end that causes an error, but even fixing that, no cigar
    • EDIT 2: tested on a previous site with PW 2.5.3

    Nothing seems to work.

    Could it be something to do with XAMPP's default PHP settings?

  3. Can't find any errors either on the Apache log or PW's.

    I'm using PHP 5.6.3 and PW 2.5.29 dev.

    Here's the output I'm getting:

    <form id="fhForm1" class="InputfieldForm" name="fhForm1" method="post" action="./" data-colspacing="1"><input type="hidden" name="TOKEN1463213210X1433263864" value="fXJQW/rrJn/a1VrW5nGRJXbxA3MrczWb" class="_post_token">
    </form>
    
  4. I'm trying this out and having some trouble. In my usecase, I want to generate a form based on a template. Here's my code:

    $fh = $modules->get('FormHelper');
    $form = $fh->create($templates->get('basic-page'));
    echo $form->render();
    

    This is outputting a form without fields except for a hidden token.

    Can't figure out what I'm doing wrong.

  5. I have a couple of problems regarding frontend template management and hacking the page tree.

    Imagine a catalogue that acts as a compilation of various lists of products from multiple users. Looking at the page tree, I have something like this:

    home

    -- products

    ------ toy

    ------ vase

    ------ phone

    -- users

    ------ john

    ------ jane

    ------ mary

    -- search

    -- ...

    Problem #1 : Direct user page links.

    Although I'm grouping users under the "users" page, I'd like to go around it and generate links that skip the users page, like so:

    www.site.com/users/john (bad)

    www.site.com/john (good)

    Problem #2 : Same product (page), two places, two frontend templates.

    Visitors can reach the main site, search and find products regardless of the user who added them, or they can go straight in a user's page and browse their specific catalogue. I'd even like to offer the option of having "John's" domain point straight into "www.site.com/john". The problem here is that I want the same product to be represented with a different template in each case.

    www.site.com/products/toy (main site template)

    www.site.com/john/toy (user specific template with extra menus and different look)

    I'm thinking maybe I need to place products inside each user's page. That may organize and simplify a bit, but I'll still have the same problem of using a different frontend template when users search from the main site.

    Any ideas?

    Thanks,

    HC

  6. If you need this to work without get variables you need to build a own way to store the $q vars between pageloads. The simplest way, that does not involve javascript stuff to happen, is storing the variable in the session of the user. From there you can retrieve it as needed before doing your pages search.

    Being the total noob that I am, I'll add this to my "nice to have" list and consider the improvement later. Right now I'm just glad I got it working :)

  7. FOUND IT!

    Teppo had part of the solution. I wasn't whitelisting the variable. But the other part of the problem was that I was usign the post method instead of get. Now it works but I'm not liking the dirty url very much (the search form passes other vars, that most of the time the user doesn't fill).

    Is this "get only"?

    Thanks for your help guys. Just now I was bragging about all the help I get from this community.

  8. @Lostkobrakai, $q is the post variable for the string. I'm catching it earlier in the header and the only action I'm performing there is an echo:

    $q = $sanitizer->text($input->post->q);
    

    @horst, for a second there I thought "THAT'S IT!", but nope. Changed the code but no effect. Now it reads:

    foreach($qs as $qf) {
        $group[] = "$f%=$qf";
    }
    

    I've also tried discarding the selector altogether and just do a --- $matches = $pages->find("template=ad, limit=2"); ---, same behavior. More pages numbers generated, but can't change page.

    Changing the method from post to get... same thing.

  9. Hi guys.

    I've seen a few posts regarding problems with search and pagination and can't figure out what's going on.

    I started out with the new blog template's search. There's an IF at the beginning that checks if the query is blank, and I made my changes in there.

    if($q) {
            
    	$q = $sanitizer->selectorValue($q);
            
            $qs = explode(" ", $q);
            $fields = explode("|", "ref|title|version|type|notes");
    
            foreach($fields as $f){
                $group = array();
                foreach($qs as $q) {
                    $group[] = "$f%=$q";
                }
                $selector .= ", (".implode(", ", $group).")";
            }
            
    	$selector .= ", limit=4";
    
    	// Find pages that match the selector
            $ads = $pages->get('/ads/');
    	$matches = $ads->find($selector);
            
            $pagination = $matches->renderPager();
            
            $output = "";
    
    	// did we find any matches? ...
            if($matches->count) {
    
    		// we found matches
                    $output.='    <ul>';
                
                    foreach($matches as $ad) {
                        $output.='<li>';
                        $output.='  <a href="'.$ad->url.'">';
                        $output.='</li>';
                    }
    
    		$output.='   </ul>';
    		$output.='</div>';
                    $output.= $pagination;
    
    	} else {
    		// we didn't find any
    		$output = "<h2>Sorry, no results were found.</h2>";
    	}
    
    } else {
    	// no search terms provided
    	$output = "<h2>Please enter a search term in the search box (upper right corner)</h2>";
    }
    
    echo $output;
    

    So testing this out, the number of pages ir rendered correctly, but when I click a page, this code always goes into "no search terms provided". The post variable is obviously not being carried over, but looking the examples don't seem to do anything about that.

    What did I miss?

  10. Hi guys.

    I'm trying to build a complex search and so far it seems over my head. Can't find an answer digging through the docs or the forum so here goes.

    Basically I have a bunch of fields (textfields, textareas and selects) and I want the search keywords to be compared to values in all of them. I'm having trouble with the selects:

    $selector = "ref|title|type|version|state%=$q";

    Since 'state' is a select, I get...

    Error: Exception: Operator '%=' is not implemented in FieldtypeSelect

    Oh and since I'm here, there's another problem. I need this search to look for each word without regard for sequence. For example, if I have a page called "this and that" and search "this that" doesn't find it. I have tried using *tilde* instead of %, but that doesn't find keywords shorter than 4 chars and I need that as well.

  11. The fact that I got all this input overnight is in itself a good argument.

    I intentionally omitted what I already did in the meeting to defend PW, and it's nice to see other people mentioning the same things:

    • Told my personal experience, not being a backend coder, I have built my personal site completely from scratch and didn't get stuck even once;
    • After my experience, brought PW to my engineering department, asked them to build one of our client's site with PW and got such good input that it's now our dev platform for small to medium projects (cases such as Volvo's CRM we use our own platform);
    • Showed him hands on how easy it is to make changes to my own website, added a field to my portfolio section, customized it and had it output on the frontend (under 5mins);
    • Demonstrated that PW doesn't make any assumptions whatsoever as to what you're going to build, being a blog, products catalogue, news magazine, etc;
    • Mentioned that it's been around for 7 years (is it?) with regular updates and we have a new major update coming this week;
    • Explained the learning curve: any programmer that picks up PW will be building a website the next day.

    Still, great extra arguments here. I owe you guys a beer!

    • Like 5
  12. Comunity unite!

    Today I tried to convince a "quite high profile client" to have a new site built with ProcessWire. He's not completely convinced.

    This is a well known, nation-wide brand with a big audience. They've invited a few agencies to show them what they've got, requiring an open-source platform "such as Wordpress or Drupal". We've of course introduced them to the wonderful world of PW but, since they've never heard of it they weren't quite comfortable and insisted on either the W or the D. It's a basic known vs unknown dilemma.

    Their main concerns:

    • Support / Community - finding other devs in case my company shuts down
    • Security - don't want to get hacked
    • Guarantees - as in they feel comfortable that WordPress and Drupal won't go anywhere and keep getting updates, but what about PW?

    So help a brother out: If you had to answer "Why should I buy as website built with ProcessWire instead of Drupal or Wordpress?", what would you say?

    Thanks,

    HC

    • Like 1
  13. Hi all.

    So after my first experience with PW on my personal site I want to try something bigger in scope.

    I'm experimenting with a system that will allow users to register themselves, and then will let them create and edit pages. This will all happen in the front-end in a custom user area, not in the back-end.

    So my question is: would it be best to register these users as regular users, or should I create them as pages and manage them as such? This second approach strikes me as safer, keeping the real admin area out of the equation, but I'd like to hear the thoughts of someone more experienced in PW.

    Thanks.

  14. Can I ask what you built the Volvo CRM with?

    Also feel free to submit yourself to the dev directory at http://directory.processwire.com

    Volvo's solution is custom-built from scratch. At YAP we have our own CMS platform that we've been building and improving over the years. There's a smaller project that I convinced our coders to try out PW and see how it compares to using our own platform. It will be interesting to see how that goes.

    Oh and thanks for the tip. I just added myself to the directory.

    • Like 1
×
×
  • Create New...