Jump to content

justb3a

Members
  • Posts

    321
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by justb3a

  1. @dougwoodrow It changed a lot, for example in the initial version the module generated a template file, so that everybody could adapt the html (form) structure as needed. But it turned out that this led to a lot overhead for me to support it. Furthermore I lost the possibility to use the ProcessWire way of handling form inputs, setting error messages, validation, form processing and so on. Therefore I decided to generate the complete form and offer as many options as possible to be able to adapt the markup / classes. Saving messages is still possible – with the difference that you're able to define the `save-messages-template` as well as the `parent`. So handling multiple (different) forms  isn't a problem...

    • Like 1
  2. @dougwoodrow I guess, $this->allFields doesn't return an array due to module update issues v0.2.1 -> v1.0.7. I'm not quite sure if it works to update directly, I tried to keep everything downward compatible, but this is a really huge difference.. You could try to update version by version and always make sure to save module settings. Otherwise you could try to update the module settings json manually (not recommended but maybe the only way; edit column data in table modules, row where class equals SimpleContactForm).

    @alan There' s a new module version (1.0.8) which adds an option to prevent form resubmission (activate checkbox in module settings).

    • Like 1
    • Thanks 1
  3. On 27/11/2017 at 7:32 PM, Donald said:

    3. At the moment are just basic test fields are added like name, street ...

    Just basic test fields.. sometimes just some basic fields do break something. If I know that you use an email field with the checked option verify email address, it's pretty easy for me to submit a hotfix and exclude it from the counter. Thanks @maxf5 for pointing it out.

    On 27/11/2017 at 7:32 PM, Donald said:

    . Also I do not understand when to use the prefix scf_ and when not

    You don't have to use the prefix at all. All fields which are added by the module will be prefixed – just to make sure the name has not been chosen yet. Please do not rename scf_website and scf_date because they are used for spam tests. The rest is up to you!

    • Like 3
    • Thanks 1
  4. 18 hours ago, Donald said:

    my personal opinion is that authors should care more about documentation. 

    Fell free to improve the documentation! You could easily send a pull request. This is open source. I develop it in my spare time. I don't receive any money doing this. I developed this module for personal use, and thought, it would be nice to share it with others...

    On 25/11/2017 at 3:50 PM, Donald said:

    but how can I create a second contact form on another page with totally different fields? 

    @see: Render multiple instances

    18 hours ago, Donald said:

    In the log file I always get: Number of fields does not match

    To figure out what causes this, it would be a good starting point to provide a bit more information. For example: which fields are added, how do you execute the module---...

    • Like 5
  5. On 28/10/2017 at 5:39 PM, Macrura said:

    i will be submitting a PR soon so once that happens and if it is accepted you could switch back to the official branch; but if it works for you and satisfies your current requirements, it should be 'stable', there are just a few simple changes to the code and those added inputfields. if you do run into any issues, you can post an issue on the forked github issues page..

    I created a "Pull Request" at my own and extended the module config, so one is able to define a date range and reverse sorting. Thanks @Macrura

    • Like 4
  6. @titanium The problem wasn't that you entered multiple fieldnames at once. The comma-separated may not include spaces. So entering `contact_title,contact_firstname,contact_lastname...` does work. I added a hotfix which removes the spaces before parsing the string.

  7. On 17/02/2016 at 9:33 PM, justb3a said:

    Could you please try to rename the field so that it doesn't contain camelCase (capital letters)? For example field_backgroundImages to field_background_images. Have a look at the description: "Any combination of ASCII letters [a-z], numbers [0-9], or underscores (no dashes or spaces)."

    Please rename headerImage to header_image (or something like this) and try again.

  8. On 21/09/2017 at 9:14 PM, maxf5 said:

    Any ideas? How do you set up checkboxes?

    Hei, I found some time to reproduce your issue. The logfile (BE > Logs > Simplecontactform-log) contains the reason what's going wrong:

    > [FAILURE] Number of fields does not match.

    This means that the number of submitted fields does not match the number of fields which are present in the form. Looking further it turned out that $this->input->post does not contain the checkbox field (if it wasn't checked). 

    It's a standard browser behaviour that the value of a checkbox is only sent if the checkbox was checked. This means I have to exclude this fieldtype when comparing number of fields / counting fields. coming soon...

     

    Edit: Just published a new release / version 1.0.5. Please update.

    • Like 1
    • Thanks 1
  9. On 03/09/2017 at 11:43 PM, PWaddict said:

    Hi @justb3a I just found your module and I was wondering if you could add a cropping option field with all of it's values: northwest, north, northeast, west, center, east, southwest, south, southeast.

    @PWaddict: There is already a module for cropping images: CroppableImage3

    On 04/09/2017 at 10:29 PM, theo said:

    Very useful Module.

    Is there a way to hide / unpublish a single image temporarily instead of deleting (trashing) the entire image + information?

    A checkbox for this would be great.

    Thank you.

    @theo: Actually the core/module do support it in a way that's not immediately obvious or as straightforward as checking a checkbox, but it's still quite useful and worthwhile when you need the capability. You could use tags or any other image extra field to achieve this. 

    1. Edit any existing files/images field, or create a new one.

    2. When editing the field settings,  check the box to enable “tags”, or create a new extra field named “hidden“ or something like that.

    3. In the “tags” or “hidden“ field for the image (which should be unpublished), enter a specific phrase like “hidden" (tags field)  or “1“ (hidden field).

    4. Now you need to check if the file should be shown on the front-end of your site. Here's how you do that:

    // tag usage example
    if (!$image->hasTag('hidden')) echo "<img src='$image->url' alt=''>";
    
    // extra field hidden example
    if (!$image->hidden) echo "<img src='$image->url' alt=''>";
    
     

    You could also send a feature request to add this as a core feature (so you do not need to check manually whether the image is hidden and as an extra bonus the hidden images would be visible at first glance using opacity to indicate that).

    • Like 1
  10. @geedamed I took me some time but I figured out, what the problem might be. I found a fix, but I do not understand exactly why this is happening. So if anybody could explain this behaviour, feel free to share it :)

     I added the `already formatted` check because in some cases the formatter was called twice (which could break the output). Let's define `in some cases`:

    • images are outputted on the same page as saved to
    • it just counts for the first/one image field

    I compared the passed HookEvents. The only difference was that in the first argument, which contains the current Page object, the page title was missing.
    So I added a check whether the Page object does contain a title, otherwise skip the formatter. I tested different cases (multiple images, multiple image fields, output from another page and so on). Seems to work – or every extra field the formatter is only called once. 

  11. It's not that easy to access only this field, you could add a class for every "InputfieldText" for example.

    But why not extending your CSS as @alexmercenary suggested? If you do not want to use an ID as CSS selector you could use classes as well.

    This is the default markup:

    <div class="form__item form__item--scf-website" id="wrap_Inputfield_scf-website">...</div>
    <div class="form__item form__item--scf-date field--required" id="wrap_scf-date">...</div>

    As you can see, every field gets wrapped using the class form__item--{fieldname}. Just extend your CSS:

    .hidden, 
    .form__item--scf-website {
        display: none;
        visibility: hidden;
    }

    :)

  12. 15 minutes ago, Lance O. said:

    What about this module makes to specific to PW 3.x and above? I would like to be able to use it on site using PW 2.7.2.

    This module uses namespaces which has been introduced with PW 3. I upgraded all my projects to PW 3.x, so I have no need to test and support older versions. :) 

    • Like 1
  13. Hi,

    since extra fields aren't regular ProcessWire fields you cannot access the labels using `->getLabel()` method or `->label` property.
    The extra field labels are saved in the regarding field settings (table fields, column data) using json and looks like this:

    {"otherFieldSettings":"{\"cf_label\":{\"cf_label__location\":\"Location\",\"cf_label__location__1012\":\"Ort\",\"cf_label__custom__1013\":\"Paikka\"}}"}

    You can get the label using this functionality:

    $fieldSettings = $fields->get('images')->otherFieldSettings;
    $settings = json_decode($fieldSettings);
    echo $settings->cf_label->cf_label__location;

    As you can see there is no error handling or fallback strategy. Therefore I updated the module and added a method called getExtraLabel()

    Usage example:

    // outputs something like: "Location: Munich"
    echo $image->getExtraLabel('location') . ': ' . $image->location;
    
    // outputs something like: "Ort: München"
    echo $image->getExtraLabel('location', 'de') . ': ' . $image->location;


     

    • Like 3
  14. On 28/06/2017 at 9:53 PM, Pixrael said:

    Since I haven't received answers, I add the code directly in the module (I know is bad but I need to finish)
    Line 264:

    
    $inputfield->attr('class','form-control');

    It would be great if this option was in the configuration as well as the current option for the Send button

    Hi, I spent the last days without a computer (holidays!!) so I didn't read my emails :)
    But the forum offers a lot of good advice and you're not the first one who asking this. So please have a look at the following posts / answers:

×
×
  • Create New...