ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

parse="inward" parameter in the weblog tag?

July 04, 2007 5:48pm

Subscribe [4]
  • #1 / Jul 04, 2007 5:48pm

    BlackHelix

    226 posts

    Sorry for resurrecting this old topic…. but as nice as this undocumented feature is, can you pass a parameter to the inner tag? 

    Since this topic has been split (thank, Sue!) I’ll explain a bit farther.  It’s an undocumented feature of EE that you can put a tag inside the parameter string of another tag, if you use the parse=“inward” command—it’s not just for plugins.  This means, for example, that you can use a plugin to set the value of a parameter of another tag.  Works great, though it’s not yet documented as it may change, I understand. So that’s what this is all about…

    So to continue this example in the thread….

    {exp:weblog:entries weblog="{my_weblog}" category="{exp:my_plugin_here "parameter_info_for_my_plugin"}" parse="inward"}
    <h2>{title}</h2>
    <p>{body}<br />
    {/exp:weblog:entries}

    As you can see, I’ve added some parameter info into the inner tag.  But it doesn’t work, I suspect, due to the fact all the quotes are double quotes and it borks things up.  It’s a shame, because that really limits the potential usefulness of this undocumented feature, if you cannot pass any information into your inner tag.  Unless there’s a way?

  • #2 / Jul 04, 2007 8:56pm

    Sue Crocker

    26054 posts

    I don’t have an answer for you, but it you use single quotes, can you get it to work?

  • #3 / Jul 04, 2007 9:12pm

    BlackHelix

    226 posts

    No, I tried that as well.  I took a look at the code, and it only seems to check for double quotes (I don’t believe single quotes are legal as a parameter delimiter—if so, that would rock), but I could be wrong.  If that’s so, I think this can’t work, at least as currently implemented.  What happens is the tag parser closes things prematurely, and it just won’t work.

  • #4 / Jul 04, 2007 9:17pm

    Sue Crocker

    26054 posts

    Just a quick note, I split the topic and put your part of the thread into the HowTo forum. This will allow other members of the community to see if they can help.

  • #5 / Jul 04, 2007 9:31pm

    BlackHelix

    226 posts

    Thanks, Sue!

    I edited my post to explain a bit farther. 

    What I wanted to do was to extract the custom member profile data I’ve set up and use that info to control what the weblog entries tag displays; i.e. select a category based on the choice the member picked in their custom profile field.  The current member profile field functions are a tag pair, and you can’t use that inside another tag. 

    Php can do it easy enough, but I was hoping to make a plugin that would do it for you so php wouldn’t need to be enabled.  My plugin prototype works great by itself, but since you have to pass in the required field you want as a parameter to the plugin… it’s running into this issue I described in this thread.  You can’t use parameters inside parameters, I think.  Which is a shame, because this feature becomes much less useful not just for me but for any other plugin or module either.  Unless there is some trick I don’t know about?

  • #6 / Jul 04, 2007 9:33pm

    Derek Jones

    7561 posts

    You can, Vanceone, but you need to be careful with your quotes.  Use one or the other on the primary tag, and the opposite on your plugin tag, i.e.:

    {exp:weblog:entries weblog="{my_weblog}" category="{exp:my_plugin_here foo='bar'}" parse="inward"}

    Otherwise it’s going to break the category parameter as {exp:my_plugin_here foo=.  And your example didn’t have a parameter name, just a value, which may have been the problem if/when you tried using single quotes on the inner tag previously.

  • #7 / Jul 05, 2007 11:17am

    BlackHelix

    226 posts

    Thanks, Derek—I have no idea why this didn’t work before, because I’m sure I wasn’t that much of an idiot and left out the parameter entirely. 

    But then, stranger things have indeed happened.  It DOES work, though, which is sweet.  And now I almost have my plugin ready for release.  I’ll post it up in the plugin forums….

  • #8 / Jul 21, 2009 12:52pm

    nathanpitman

    531 posts

    Hi guys, just stumbled across this post after discovering that a bespoke module that we’ve been working on couldn’t pass entry IDs to the weblog:entries tag, they seemed to get parsed in the wrong order… anyhow… the parse=“inward” parameter made everything rosy! Is there any chance of this being documented or ‘officially’ supported? Can we rely on it still being available in ExpressionEngine 2.x?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases