by
KK » Tue Jun 16, 2015 7:01 pm
I'll try explain

Internally, all relation fields store only IDs.
However, to make it easy for users to work with them they display the 'names' of the related pages instead of the stored IDs.
Normally you don't need to explicitly set values into the relation fields (the GUI suffices) but when this needs to be done (as in your case using databound form), we have to supply IDs as that is what is stored.
Relation fields are somewhat special in the sense that they store their data in their own tables - you saw this when you tried printing out <cms:show member /> and it outputted nothing.
We need to use either cms:related_pages/cms:reverse_related_pages to get the data out from these fields. With 1.4.5RC1, the 'custom_field' parameter of cms:pages has also begun to recognize the relation fields.
So when you used the following with cms:pages -
- Code: Select all
custom_field="member=<cms:show k_member_name />"
- the 'member' field was being given special treatment - you provide a 'name' and it gets resolved internally to the ID.
If you'd rather prefer to provide an explicit ID, it will require signalling this fact to cms:pages by using this syntax -
- Code: Select all
custom_field="member=id(<cms:show k_member_id />)"
Bottom line is that the relation fields try to interface using the 'names' as that is easier than using IDs but internally everything is stored as IDs.
Hope this helps.