Search the Community
Showing results for tags 'helper'.
-
Inputfield Dependency Helper Adds "Insert field name" and "Insert value" dropdown menus to help with constructing show-if/required-if conditions, aka inputfield dependencies. The "Insert field name" menu helps you remember the field names that exist in your site (or exist in the current template) and avoids typos. The "Insert value" menu lets you select values for Page Reference or Select Options fields via the human-friendly label whereas the show-if/required-if conditions require those values to be inserted as numerical IDs. Insert field name When you click the button a dropdown menu appears listing field names, with the field labels in parentheses. When editing a field in template context only the fields that exist in the template are listed, and the field labels are in template context. When editing a field outside of template context all the non-system fields are listed. When you click an item in the list the field name is inserted into the settings field. Insert value When using a Page Reference or Select Options field value in a show-if/required-if condition you have to enter the numerical ID of the page/option, and this is not so user-friendly – often you have to switch to another tab and go and look up the relevant ID. The "Insert value" button is intended to make this process easier. When you click the button a dropdown menu appears listing any Page Reference and Select Options fields that exist in the current template (when editing in template context) or in the site. When you click one of the fields the selectable options for the field are AJAX-loaded into a flyout menu. Clicking one of the selectable options will insert the numerical ID of the option into the settings field. Configuration In the module config you can set a limit to the number of selectable options shown in the menu, so the menu doesn't get excessively long. https://github.com/Toutouwai/InputfieldDependencyHelper https://processwire.com/modules/inputfield-dependency-helper/
- 2 replies
-
- 9
-
- module
- dependencies
-
(and 3 more)
Tagged with:
-
A module to work around a few shortcomings of Fieldset and FieldsetPage fields. Not submitted to the modules directory because I'm hopeful that most if not all of this will be handled in the core eventually. https://github.com/processwire/processwire-issues/issues/1953 https://github.com/processwire/processwire-requests/issues/533 https://github.com/processwire/processwire-requests/issues/534 Fieldset Helper Adds some visibility features to fields of type FieldtypeFieldsetOpen and FieldsetPage, and adds a helper method to get the child fields of a FieldtypeFieldsetOpen field. Visibility The module adds support for the following visibility settings to FieldtypeFieldsetOpen and FieldsetPage fields: Open when populated + Closed when blank Open when populated + Closed when blank + Load only when opened (AJAX) * Open when populated + Closed when blank + Locked (not editable) Open when blank + Closed when populated "Blank" in the context of a fieldset means that all the child fields within the fieldset are blank. * The AJAX part of this option doesn't currently work for FieldsetPage. Get the child fields of a fieldset If you've ever wanted to get the child fields that are within a fieldset you will have noticed that the ProcessWire API doesn't provide a direct way of doing this. Although they appear indented in Edit Template, the child fields are actually all on the same "level" as the other fields in the template. The module adds a FieldtypeFieldsetOpen::getFieldsetFields() method that you can use to get the child fields of a fieldset for a given page. Example: $field = $fields->get('my_fieldset'); $template = $templates->get('my_template'); $fieldset_fields = $field->type->getFieldsetFields($field, $template); First argument: the fieldset Field, i.e. a Field whose type is an instance of FieldtypeFieldsetOpen (this includes FieldtypeFieldsetTabOpen). Second argument: the Template that the fieldset field is part of. Return value: a FieldsArray of child fields. If there is a nested fieldset inside the fieldset then the child fields of the nested fieldset are not included in the return value, but of course you can use the method again to get the child fields of that fieldset. https://github.com/Toutouwai/FieldsetHelper
-
Hello, I created a simple REST helper in order to create REST APIs with Processwire, without depending on external routers Here you go!. https://gist.github.com/clsource/dc7be74afcbfc5fe752c
- 32 replies
-
- 21
-
- helper
- processwire
-
(and 2 more)
Tagged with:
-
DrLunesTypeManager is a Template Helper. DrLunesTypeManager asks you for a typekit ID, Google Fonts Family, CDN, Custom CSS and more, and outputs the code needed to use this fonts in your templates. It also forces some tags to use this fonts and your custom CSS styles to be applied to the page. DrLunesTypeManager in github: https://github.com/biojazzard/DrLunesTypeManager Inspiration Inspired by [Dr. Rober´s](rober@1un.es) needs. ProcessWire is about efficient code, but sometimes humans need helpers. Install Via PW: + Download zip + Use modules administrator in PW to upload it to the server. + Open it and configure it with your settings. Install Via GIT: I´m not a git pro, but it´s nice to have modules as a subtree so it´s not a pain to mantain, and you can easily reuse it in other projects keeping it´s development in github as well. + Fork [DrLunesTypeManager](git@github.com:biojazzard/DrLunesTypeManager.git) + Ad it as a subtree in git with relative path site/modules/ + Edit it as you like. + Install DrLunesTypeManager with modules administrator in PW. + Open it and configure it with your settings. Module [sample] Settings Using DrLunesTypeManager in templates. Last thing is to output code, this can be done in your: $config->appendTemplateFile + DrLunesTypeManager uses jQuery. So output code AFTER **jQuery** is loaded, usually in your ``head``, but preferably before ``body`` tag. <?php // Get Module $typekit = $modules->get('DrLunesTypeManager'); // Render Script & Settings. echo $typekit->render(); // It´s done. ?> html outout MODULE-VALUE-* represents your value settings in Module´s Settings <script> WebFontConfig = { typekit: { id: "MODULE-VALUE-TYPEKIT-ID" }, google: { families: ["MODULE-VALUE-GOOGLE-FONT"] } }; (function() { var wf = document.createElement("script"); wf.src = ("https:" == document.location.protocol ? "https" : "http") + ":MODULE-VALUE-TYPEKIT-CDN"; wf.async = "true"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(wf, s); })(); // TypeKit Classes added to main text tags (function($) { $("p").addClass("MODULE-VALUE-BODY-CLASS") $("ul").addClass("MODULE-VALUE-BODY-CLASS") $("h1, h2, h3").addClass("MODULE-VALUE-H13-CLASS") $("h4, h5, h6").addClass("MODULE-VALUE-H46-CLASS") })(jQuery); </script> If you are using the **Custom CSS** field, you may add ``!important`` in order to get this styles loaded as expected: h1.tk-cubano { letter-spacing: -1px; color: hsla(360, 94%, 32%, 0.76) !important; // FORCE RED text-shadow: 1px 1px 3px hsla(360, 94%, 32%, 0.3); //SHADOW } With love. 1un.es