Answers.Body: <p>You can do this via a small plugin that provides you with a <a href="https://docs.craftcms.com/v2/plugins/variables.html" rel="nofollow noreferrer">template variable</a>. I've made you a <a href="https://github.com/olivierbon/gdug" rel="nofollow noreferrer">working example here</a> with usage example. </p>
  
  <p>It's a main plugin class with the basics then a <a href="https://github.com/olivierbon/gdug/blob/master/variables/GdugVariable.php" rel="nofollow noreferrer">variable class</a> that fetches the group <code>id</code> from your settings and retrieve the <code>handle</code> associated to that <code>id</code>.</p>
  
  <p>I'm sure there are other ways to do this but that's one. Download, change... Make it yours :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-28T08:44:47.670Z
Answers.Text: Wow, thanks so much Olivier :)
Answers.UserDisplayName: Jonathan Schofield
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-25T16:43:47.357Z
Answers.LastActivityDate: 2019-05-25T16:52:43.037Z
Answers.LastEditDate: 2019-05-25T16:52:43.037Z
Answers.UserDisplayName: Oli
Body: <p>In Craft 2, I know I can <a href="https://docs.craftcms.com/v2/templating/craft.config.html#properties" rel="nofollow noreferrer">get general config settings</a>.</p>
  
  <p>How can I get the current <strong>Default User Group</strong> (set in Settings > User Settings) for use in my templates?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-25T13:56:05.043Z
Comments.Text: I'm not sure there's a native way of doing this. Do you need the group handle or the ID?
Comments.UserDisplayName: Oli
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-25T14:10:21.847Z
Comments.Text: The group handle would be great.
Comments.UserDisplayName: Jonathan Schofield
Tags: <templating><settings>
Title: Craft 2: get default user group from user settings
ThreadText: # Craft 2: get default user group from user settings
  
  (Asked by: username_0 on 2019-05-25)
  
  In Craft 2, I know I can [get general config settings](https://docs.craftcms.com/v2/templating/craft.config.html#properties).
  
  How can I get the current **Default User Group** (set in Settings > User Settings) for use in my templates?
  
  **Tags:** templating, settings
  
  > **Comments:**
  > **username_1**: I'm not sure there's a native way of doing this. Do you need the group handle or the ID?  
  > **username_0**: The group handle would be great.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-25. Score: 2
  
  You can do this via a small plugin that provides you with a [template variable](https://docs.craftcms.com/v2/plugins/variables.html). I've made you a [working example here](https://github.com/olivierbon/gdug) with usage example.
  
  It's a main plugin class with the basics then a [variable class](https://github.com/olivierbon/gdug/blob/master/variables/GdugVariable.php) that fetches the group `id` from your settings and retrieve the `handle` associated to that `id`.
  
  I'm sure there are other ways to do this but that's one. Download, change... Make it yours :)
  
  > **Comments:**
  > **username_0**: Wow, thanks so much Olivier :)  
  
  ---
  
  