We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Get Current Entry ID

Development and Programming

Brian Bommarito's avatar
Brian Bommarito
11 posts
17 years ago
Brian Bommarito's avatar Brian Bommarito

Is it possible within a plugin to grab the current entry ID that’s being viewed?

       
Boyink!'s avatar
Boyink!
5,011 posts
17 years ago
Boyink!'s avatar Boyink!

It’s possible w/o a plugin:

Entry id variable

       
Brian Bommarito's avatar
Brian Bommarito
11 posts
17 years ago
Brian Bommarito's avatar Brian Bommarito

I’m writing a plugin that needs the entry id, that’s what I wondered, can a plugin grab the entry id when it runs:)

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

You could grab it via some queries… but… I think the easiest method would be to pass it along in a parameter:

{exp:my_plugin entry_id="{entry_id}"}

And in the plugin:

global $TMPL;
$entry_id = $TMPL->fetch_param('entry_id');
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.