I need to access just the ID of a specific section.
I do that like this and it works:
{% set enroll = craft.sections.getSectionByHandle('workshopEnrollments') %}
But when I do:
{% for e in enroll %} {{ e.sectionId }} {% endfor %}
or:
{% for e in enroll %} {{ e.id }} {% endfor %}
I get the error:
Impossible to access an attribute ("sectionId") on a string variable ("32")
However, when I view the variable inside my form what I actually see is exactly this
32Workshop EnrollmentsworkshopEnrollmentschannel1workshop-enrollments/_entry1
So my question is, how can I just display the id. Both ".id" and ".sectionId" produce the same error mentioned above.
"32" is the id I want so it is the correct return, but this seems to show everything about it in a string and I need just the id. I am using getSectionByHandle because I have no other data to use in this particular view.
Thanks for any help.