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

Parsing {variable} tags in entry custom fields - is there a hook

Development and Programming

steph_rose's avatar
steph_rose
17 posts
14 years ago
steph_rose's avatar steph_rose

I’m thinking about writing a module / extension to extend some functionality that would, ideally, allow a user to drop an {image-gallery} tag, hypothetically speaking, into the content of a body custom field for a post and have it parse.

My question is this: Is there a hook in EE2 at the beginning of rendering a custom field tag in a template, so that I could pre-parse things in the content after it’s been retrieved from the database?

Is what I’m saying clear? Not sure if I always explain well enough.

       
Roger Glenn's avatar
Roger Glenn
54 posts
14 years ago
Roger Glenn's avatar Roger Glenn

Does this do what you need?

       
steph_rose's avatar
steph_rose
17 posts
14 years ago
steph_rose's avatar steph_rose

Thanks. That will take me in the right direction. I don’t want {exp} tags parsable in entry fields, but that means there is a hook used that I’m going to want. So, downloading to take a look at the hook and then I’ll write my own plugin 😊

Perfect. I had tried to use the Googs (read: google) to find that but apparently my search term choice is sub-par.

Thank you.

       
liaorui's avatar
liaorui
5 posts
14 years ago
liaorui's avatar liaorui

This is kind of what I am looking for as well. I tried allow_eecode, but couldn’t get it work. For example, I put the following code into an entry field, and when the template shows the entry field, it still just output the code itself directly, nothing gets parsed as expected. Please help!

{exp:allow_eecode}
{exp:channel:entries channel="news_articles" limit="1" disable="pagination" status="Featured Top Story" }
img/news-article-image.png
<h4>{title}</h4>
<h5><span class="by">By </span> {author}</h5>
{article_excerpt}
<a href="http://{title_permalink=" class="read_story">Read Story</a>
{/exp:channel:entries}
{/exp:allow_eecode}
       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team
Is there a hook in EE2 at the beginning of rendering a custom field tag in a template, so that I could pre-parse things in the content after it’s been retrieved from the database?

There is! This may be what you’re looking for:

http://ellislab.com/expressionengine/user-guide/development/extension_hooks/module/channel/index.html#channel_entries_tagdata_end

I actually just used it on an EE1 extension for something. Even though it’s EE1 you can see how it was used here https://gist.github.com/1054782#L188

Edit: I just realized that this thread is a month old. I hope it’s helpful regardless! 😊

       

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.