Answers.Body: <p>The SectionModel has a type property, which return what you're after, "single", "channel" and "entry". In a template it can be accessed like this:</p>
  
  <pre><code>{{ entry.section.type }}
  </code></pre>
  
  <p>If this is in a plugin and you have the section, you access it like this:</p>
  
  <pre><code>$section-&gt;type
  </code></pre>
  
  <p>But I'm confused by the "current page" of your question. Maybe you can describe in a bit more detail what you're trying to achieve, and what your code looks like atm?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-01T12:53:01.237Z
Answers.LastActivityDate: 2014-09-01T12:53:01.237Z
Answers.UserDisplayName: André Elvan
Body: <p>Is there an easy way to check what the current page <strong>section type</strong> is, within a plugin? </p>
  
  <p>I wonder if I'm overlooking a little function that simply returns: "single", "channel", "entry", etc...? </p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>Thank you Aevlan, this was the approach I took originally. I've been struggling to determine wether the user is currently on the root of a channel/structure, or if they are on an entry page. </p>
  
  <p>This is how I can determine "single", "channel" or "structure". </p>
  
  <pre><code>$element = craft()-&gt;urlManager-&gt;getMatchedElement();
  $element_exists = $element &amp;&amp; $element-&gt;getElementType() == ElementType::Entry;
  
  $currentPageType = $element-&gt;section-&gt;type;
  </code></pre>
  
  <p>The reason I need to know this, is so I can perform some checks before I add certain navigation throughout the site. To help with my specific issue, I will use "hasDescendants()" or check the segment counts. </p>
  
  <p>Thanks again. Mark</p>
  
Tags: <plugin-development><sections>
Title: Return the current section type? (plugin)
ThreadText: # Return the current section type? (plugin)
  
  (Asked by: username_0 on 2014-09-01)
  
  Is there an easy way to check what the current page **section type** is, within a plugin?
  
  I wonder if I'm overlooking a little function that simply returns: "single", "channel", "entry", etc...?
  
  ---
  
  UPDATE:
  
  Thank you Aevlan, this was the approach I took originally. I've been struggling to determine wether the user is currently on the root of a channel/structure, or if they are on an entry page.
  
  This is how I can determine "single", "channel" or "structure".
  
  ```
  $element = craft()->urlManager->getMatchedElement();
  $element_exists = $element && $element->getElementType() == ElementType::Entry;
  
  $currentPageType = $element->section->type;
  
  ```
  
  The reason I need to know this, is so I can perform some checks before I add certain navigation throughout the site. To help with my specific issue, I will use "hasDescendants()" or check the segment counts.
  
  Thanks again. Mark
  
  **Tags:** plugin-development, sections
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-09-01. Score: 2 | Accepted answer
  
  The SectionModel has a type property, which return what you're after, "single", "channel" and "entry". In a template it can be accessed like this:
  
  ```
  {{ entry.section.type }}
  
  ```
  
  If this is in a plugin and you have the section, you access it like this:
  
  ```
  $section->type
  
  ```
  
  But I'm confused by the "current page" of your question. Maybe you can describe in a bit more detail what you're trying to achieve, and what your code looks like atm?
  
  
  ---
  
  