default userpic

Help with SetVar / SetVarBlock, etc.

Vote 0 Votes

The documentation/support for MT4/MTOS is somewhat lacking at the moment... this seems like a fairly simple problem to find an answer to, and yet with all my Google digging I haven't located anything. Here's what I'm trying to do...


<mt:SetVarBlock name="foo"><mt:EntryBasename></mt:SetVarBlock>
<h2><mt:Var name="foo" /></h2>
<mt:Assets tag="<mt:Var name="foo" />"> <mt:AssetURL><br/> </mt:Assets>

I'm basically trying to use an entry basename as a tag, then retrieve all the images that have that tag. The first mt:var call works fine... the proper name is printed correctly.

After that it goes awry... I never get a list of assets with the right tag name. I'm sure this is because I am not retrieving the variable properly and I'm not sure what is the right way since I haven't found any examples.

Is what I'm trying to do even possible with MTOS or are we stuck with static data for attribute values?

Thanks in advance.

2 Replies

| Add a Reply
  • This should be written like this:

    <mt:SetVarBlock name="foo"><mt:EntryBasename></mt:SetVarBlock>
    <h2><mt:Var name="foo" /></h2>
    <mt:Assets tag="$foo"> <mt:AssetURL><br/> </mt:Assets>
    
  • I tried that, actually... but I get rebuild errors as a result.

    An error occurred publishing entry 'September 24-28: DiGRA': Publish error in template 'Entry': Error in tag: You have an error in your 'tag' attribute: september2428digra

    Not sure what this means... best guess is that I don't have any tags named "september2428digra"... but I had assumed that if there were no assets matching that particular tag, it would just return an empty list, rather than completely fall apart...

Add a Reply

Forum Groups