Hey everyone,
This is my first ExpressionEngine plugin.
I am sure the code can be done better..but i did my best.
I will continue to add more functions to the plugin overtime..
For now it can only fetch custom weblog fields.
Features
-Get custom field without (exp:weblog:entries), and with far less queries.
-Ability to get the FORMATTED or the RAW field (raw=unprocessed)
-Ability to choose between FIELD FORMATs
-Ability to get entry title (with only 1 query) // good for Page titles.
-Ability to get rows from exp_weblog_titles
How to?
%%%%% {exp:entrydata:field} %%%%%
%%%%% Get PROCESSED custom field content from entry %%%%%
#### Parameters:
entry_id=""
url_title=""
weblog=""
weblog_id=""
field="" // Custom field shortname (required!, or use field_id="")
field_id="" // Custom field ID (required!, or use field="")
field_format="" // Custom field format (if left empty, the custom field default assigned one will be used)
site_id=""
%%%%% {exp:entrydata:info} %%%%%
%%%%% Get details of an entry %%%%%
#### Parameters:
entry_id=""
url_title=""
weblog=""
site_id=""
date_format="" // If you selected a section that is a date, you can format it.
section="" // A column found in exp_weblog_titles
Here as an list of sections on the default install of EE:
entry_id
site_id
weblog_id
author_id
pentry_id
forum_topic_id
ip_address
title
url_title
status
versioning_enabled
view_count_one
view_count_two
view_count_three
view_count_four
allow_comments
allow_trackbacks
sticky
entry_date
dst_enabled
year
month
day
expiration_date
comment_expiration_date
edit_date
recent_comment_date
comment_total
trackback_total
sent_trackbacks
recent_trackback_date
Example
// Fetch the BODY custom field based on EMBEDDED ENTRY_ID // use XHTML as field format
{exp:entrydata:field entry_id="{embed:entry_id}" field="body" field_format="xhtml"}
// Fetch the BODY custom field based on URL_TITLE // use NONE as field format
{exp:entrydata:field url_title="{segment_3}" field="body" field_format="none"}
// Fetch the RAW BODY custom field based on URL_TITLE . (Unprocessed, really RAW)
{exp:entrydata:field url_title="{segment_3}" field="body" field_format="raw"}
// Fetch the title of an entry.
{exp:entrydata:info url_title="{segment_3}" weblog="default" section="title"}
// Fetch the entry_date of an entry.
{exp:entrydata:info url_title="{segment_3}" section="entry_date" date_format="%D, %F %d, %Y"}
Bugs, Suggestions, questions, improvements, ideas...WELCOME !!!
Thanks to: Leevi Graham & Brent Wilson & Mitchell (Solspace) for their help.
Changelog
-1.1 // Fixed a looping bug (function re-declared)
-1.0.1 // Fixed ee_code being left out from the output
-1.0 // Global variables are now parsed & added exp:entrydata:info (get one of the columns from exp_weblog_titles)
-0.6 // Added entry_date & edit_date retrieval functionality (downloads: 96)
-0.4 // Added url_title retrieval functionality (downloads: 36)
-0.3 // Added title retrieval functionality (downloads: 28)
-0.2 // Bug fix in entry_id parameter (downloads: 17)
-0.1 // First Release (downloads: 34)
