Jump to content

Context for field type


palacios000
 Share

Recommended Posts

It allows you to save settings for a field on a per template basis. Let's say for a template called 'flats' you want the label of that field to be 'Available'. On another template, , called 'agents', you can reuse the same field but give it a different label, e.g. 'Premium'...

You can also edit context settings when editing the list of fields when editing a template. Hover your mouse over the label of the field and an arrow will appear. Click on that, it opens a modal and you can set 'in context' changes there.

Recent changes to PW (can't remember version) introduced the ability to save lots (all?) field settings on a per template basis. This is a really powerful feature, like many others in PW :-)

Edited by kongondo
  • Like 3
Link to comment
Share on other sites

Hi @palacios000!
 
What @kongondo said. :) 
 
I use the 'context' dropdown for two things:

1. to make my backend template forms look nice and compact, and

2. to reduce the amount of fields I need to use and create. I will explain this one because it is probably the most useful.
 
So instead of having these fields and titles in these templates:
 

Template: Houses

with fields:

  • house_address (label: House address)

  • house_available (label: House available?)

  • housing_development (label: Housing development)

Template: Flats

with fields:

  • flat_address (label: Flat address)

  • flat_available (label: Flat available?)

  • building_name (label: Building name)

 

Template: Mansion

with fields:

  • mansion_address (label: Mansion address)

  • mansion_available (label: Mansion available?)

  • mansion_name (label: Mansion name)

I can do this:

Template: Houses

with fields:

  • address (label: House address)

  • available (label: House available?)

  • name (label: Housing development)

Template: Flats

with fields:

  • address (label: Flat address)

  • available (label: Flat available?)

  • name (label: Building name)

 

Template: Mansion

with fields:

  • address (label: Mansion address)

  • available (label: Mansion available?)

  • name (label: Mansion name)

I use the same three fields for slightly different things on different templates. 
 
This is helpful because when I'm writing code where, say, I want a list of all properties, I only have to call three fields.
 
Does this make sense?
  • Like 6
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...