-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By DxJR
So, I've tried looking through here and Can't seem to find it. I'm trying to create a situation in the admin where:
I have a page reference InputField. When the user chooses one of those pages, from the dropdown, a new Page reference drop down pops up with that pages children in it. I know how to do the "show only if..." thing, but How did I make it dynamically pull in a pages children? Thanks
-
By obesegiraffe
Hi all, first time poster on the forums but long-time user of Processwire. I couldn't find this exact problem in the forums and I'm hoping it's just something simple I'm missing (first day back from vacation so I am a little brain dead).
I have a Select Options Field Type where the client can choose an array of numbers. If nothing is chosen, nothing is outputted onto the page. This works for most pages using this specific template. However, on just one page where I have the field set to blank, I am finding it is still outputting "0", when it actually shouldn't be outputting anything. My code:
<?php if($page->percent_leased->has('id!=0')){ ?> <h2><?=$page->percent_leased->title?>% Leased</h2> <?php } ?> On this specific page, it is outputting "0% Leased". It's also doing something kind of weird in the database under the percent_leased field type. It's repeating the same ID of the specific problem page twice (page ID 1086) when I set it to blank. It works fine if I actually choose a number and the duplicate goes away. I've never really delved deep into the databases so maybe this is normal?
The weird thing is is that this is working fine on all other pages using this template. It's just this one page acting weird. FWIW, this particular site is running version 2.6.1.
Thanks for reading!
-
By gebeer
Happy New Year to everyone!
For a project that I'm working on, I needed to have dependent checkboxes on page edit forms in the admin. Just like dependent selects but for checkboxes. I couln't find anything and decided to write my first Inputfield module.
I have only tried it on PW > 3.0. But it should also work on the 2.x branch. Would be great if some of you could try it out and give some feedback.
You can find the module InputfieldDependentCheckboxes at github
Here's some screenshots of the module in action and instructions on how to use it.
##An Inputfield for ProcessWire admin interface that handles the display of dependent checkboxes in page fields
Sometimes we need checkboxes to depend on other checkboxes in our page edit forms. This module adds this functionality to standard page field checkboxes for 2 or more checkbox fields.
## Installation
1. Copy all of the files for this module into /site/modules/InputfieldDependentCheckboxes/
2. In your admin, go to the Modules screen and click "Refresh". Under the 'Inputfield' section, install the 'InputfieldDependentCheckboxes' module.
3. Open Modules->Configure->InputfieldPage. Under 'Inputfield modules available for page selection' add 'DependentCheckboxes' from the select dropdown and submit
##Field Setup
This inputfield extends the standard checkboxes for page fields. Therefore you need to have page fields configured already that you can extend with this Inputfield type.
###Prerequisites
You need to have at least 2 fields of type page that have 'Checkboxes' defined as Input field type and live on the same template.
A real world example:
There are different types of instructors. Each instructor type can have multiple different certifications.
For this to happen, we need 2 page fields (multiple):
A) instructor_types: lists pages with template 'instructor_type'
B) certifications: lists pages with template 'certification'
The certification template needs to have the instructor_types page field to assign one or more instructor_types to a certification.
###Setup (link checkbox fields)
1. Edit your page field A and go to the 'Input' Tab. Under 'Input field type' choose 'DependentCheckboxes'. Hit save. Now under 'Choose the target checkboxes field' choose the name of your field B. Hit save again.
2. In your page field b make sure to choose a template under 'Input' Tab under 'Selectable Pages'->'Template of selectable page(s)'.
Your fields should be setup. If you now edit a page that contains the 2 fields, the dependent checkboxes should be working.
EDIT: And yes, this is working for multiple dependent checkboxes, too. (I have tried it with 3 so far)
Some notes on how the module works behind the scenes:
- parent checkboxes (actors) that have dependent checkboxes (targets) get custom data attributes applied which contain arrays of the targets' IDs
- some Javascript is initiated on acxtors and targets to handle the display based on the id arrays in the data attributes.
EDIT: since this module's mention in ProcessWire Weekly it might get some more attention. I just wanted to point out that it is still in alpha state. I will continue development and more thorough testing while implementing it in an ongoing project within the next 3-5 months or so. I will eventually release a stable version then.
If you use the module with only 2 dependent checkbox fields, it should work smoothly. There are still some quirks when using 3 or more and I need to figure out how to best resolve them. So please be patient (or jump in with ideas ).
-
By biotech
Hello everyone,
Brand new to PW and after few hrs loving the potential and control but hating my state of ignorance
I understand that page hierarchy is one way to organize (categorize) content so I am trying to build Categories for use in a Blog type of content.
So far, I have made a page called "Categories" with simple just "title" field and created children records (subcategories).
In my 'blog' I created a field called "categories" and used it to pull records from the page above.
However, any input field type I choose does not pull children records and only parents are shown.(i.e camping and photography)
The only field type that is capable is "PageListSelectMultuple*" but unfortunately there is no way to prevent duplicated categories/pages to be selected.
Checkboxes would be my preference but not sure how to go about it all or what am I missing in the setup.
Thank you for your time.
O.T. but where would I find 'skyscraper site profile' to download?
-