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
Thanks for the great replies, today/tomorrow i will add url_title functionality.. If someone has some idea’s on which other info to fetch from entries..please..
What happens though if you place say five or six of these on a page to bring back just one field at a time. Is it still less intensive on SQL queries than using the weblog tag?
What happens though if you place say five or six of these on a page to bring back just one field at a time. Is it still less intensive on SQL queries than using the weblog tag?
Best wishes,
Mark
Hi Mark,
Well it depends:
-If you now are using more then 1 {exp:weblog:entries} currently, then you can consider doing it.
-If you only are using 1 {exp:weblog:entries} in your template..not sure if it’s worth it then.
It is also good for embedded templates, when you want to pass a custom field to another template but don’t want to call {exp:weblog:entries} again in the embedded template.
Thanks for the reply. Not too sure I am totally understanding what you have said though so please excuse my asking again.
Let’s say for instance I was on a single-entry page and I had 15 custom fields that I wanted to bring back. At the moment as far as I can with most sites I only really ever have the one weblog tag on a page surrounding most everything. This would allow me to bring back the 15 custom fields. If instead on this single-entry page I placed 15 of your plugin tags would this still be less query intensive in that way or would the weblog tag be better off?
In your situation the {exp:weblog:entries} is a better choice since you only call the tag once.
My plugin is useful for situations:
-Get custom fields of OTHER entries while inside of the {exp:weblog:entries} of another entry.
-Get custom fields of an entry while in an embedded template.
-Where you don’t want to use the {exp:weblog:entries} twice for just 1 or 2 custom fields.
-And some other situations where the {exp:weblog:entries} is overkill.
Thanks. That all makes perfect sense. I guess I hadn’t thought about its use completely when I asked that but just thought it was a valid question. I can definitely see good uses for this plugin and it is definitely one I will keep in my arsenal for the future.
Fantastic work for your first plugin. Totally puts mine to shame although in my defence mine were requested!!
Just kidding. Your plugin is fantastic and I am 100% positive you will get a lot of very positive feedback on it and let me be the first to give you 200% positive feedback
Thanks again for giving me some more examples to put my tired brain to rest.
I’m sure this would be handy in different situations, but I think it would definitely be useful for grabbing an entry {title} for <title></title> tags in a page header. Saves using {exp:weblog:entries} just to turn everything off again.
I’m sure this would be handy in different situations, but I think it would definitely be useful for grabbing an entry {title} for <title></title> tags in a page header. Saves using {exp:weblog:entries} just to turn everything off again.
Hi,
You could use Title plugin by Lodewijk. It does exactly what you want.
In future version of the plugin i will incorporate Title also.
It would be great if the output of {exp:entrydata:field} tag were identical to the output of {exp:weblog:entries} tag which pulls data from the same field.
Unfortunately there is quite serious difference. If you use {exp:weblog:entries} tag, you can enable EnpressionEngine’s code in it’s fields by wrapping them (or entire {exp:weblog:entries} tag) with Allow EE code plugin’s tags {exp:allow_eecode} and {/exp:allow_eecode}. But if you wrap with {exp:allow_eecode}{/exp:allow_eecode} tags the tag {exp:entrydata:field}, EnpressionEngine’s code does not get rendered. Even global weblog variables are being displayed uninterpreted.
Maybe there is some workaround to get parsed EnpressionEngine’s code pulled from a field via {exp:entrydata:field} tag?