Campaigners have won a challenge at the UK's highest court against the Scottish Government's named person legislation but it does not mean the law cannot be implemented if parts of it are changed.

:: What is the named person legislation?

Part of the Children and Young People (Scotland) Act 2014 passed at Holyrood, the law involves a single point of contact, such as a teacher or health visitor, appointed to look after the welfare of every child in Scotland up to age 18.

READ MORE: Scottish Government's Named Person scheme ruled 'unlawful' by Supreme Court

:: Why did the Scottish Government create the new law?

Scottish ministers say the service will act as a safety net to help families and children if needed.

:: Why is it controversial?

Objectors to the scheme claim it legitimises state snooping and say it breaches the human rights of parents, eroding family privacy in favour of the state.

:: Who brought the legal challenge?

An appeal against the law was brought by four charities - The Christian Institute, Family Education Trust, The Young ME Sufferers Trust and CARE (Christian Action Research and Education) - and three individuals, Falkirk couple James and Rhianwen McIntosh and Deborah Thomas from Comrie, Perthshire.

READ MORE: Scottish Government's Named Person scheme ruled 'unlawful' by Supreme Court

:: What did the court decide?

Five judges sitting at the Supreme Court allowed the objectors' appeal. They ruled the overall aim of the legislation in appointing named persons does not breach human rights but singled out the information-sharing protocols in the new law, ruling they may interfere in human rights to a family and private life as well as risking breaching rules on privacy and confidentiality.

:: What happens now?

The court ruled the law cannot be brought in to force "in the meantime" and has given the Scottish Parliament and Scottish ministers 42 days "to agree an order which will set out a timetable for rectifying the legislation, if they so wish". Campaigners have hailed the ruling as a victory but the Scottish Government said it will bring the law into force as soon as possible and is now working on the changes required.