silverstripe / silverstripe/developer-docs

Docs: Info about how to debug a variable in the template is missing

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects/v4 complexity/low impact/low type/docs
Dominant language
No language data
Stars
7
Forks
74
Avg merge
1d 14m
Merged PRs (30d)
6

Description

Affected Version

Current docs

Description

I wasn't able to find information how to debug a variable while trying to help a newbe on slack:

Q: I am new with SilverStripe and I want to know if exists equivalent of print_r or var_dump inside SilverStripe template

A: $Foo.Debug shows the value of $Foo. Indside a loop you can call $Me.Debug to get the current variable in the loop

At which document do you think we should insert information about how to debug variables in templates? Would https://docs.silverstripe.org/en/4/developer_guides/debugging/template_debugging/ be good or should it go to the templates section, e.g. https://docs.silverstripe.org/en/4/developer_guides/templates/common_variables/ ?

Steps to Reproduce

Search docs ;)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the existing template debugging page with the templates common variables page linked in the issue. Confirm where guidance for $Foo.Debug and $Me.Debug fits best, then add the explanation and make sure it is discoverable when searching the documentation for debugging template variables.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.