Recursive template macro parameters Options
Itamar
Posted: Sunday, August 03, 2008 11:10:00 PM
Rank: Devotee

Joined: 10/30/2007
Posts: 95
Location: Israel
Hi,

Consider the following template code:

Code:
<?UMBRACO_MACRO macroAlias="HC_MyMacro" mID="[@mID]"></?UMBRACO_MACRO>


This is a template for Doc2, which is the child of Doc1. Doc1 has mID set, Doc2 has no mID at all. What [@mID] will be passed? my guess is 0, right? so how can I make it recursive, or at least to read the value from its parent?

Thanks in advance.

Itamar.
neehouse
Posted: Monday, August 04, 2008 11:45:11 AM

Rank: Umbracoholic

Joined: 7/20/2006
Posts: 1,076
Location: Charleston, West Virginia, United States
Hi Itamar,

[@mID] is pulling a query string value. Beyond that, what type of macro are you creating? XSLT, user control, python?

In v.3, recursive macro properties do not exist the way that you are attempting, but can be obtained through programming.

• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
Itamar
Posted: Monday, August 04, 2008 6:05:18 PM
Rank: Devotee

Joined: 10/30/2007
Posts: 95
Location: Israel
Thanks for your reply.

I'm using 3.0.5. I have an XSLT macro, and I want to get a document field for the current document or its parent. How would I do that then? I was sure [@mID] will get a document field (from a docuemt type)?

Itamar.
Itamar
Posted: Sunday, September 21, 2008 7:45:24 PM
Rank: Devotee

Joined: 10/30/2007
Posts: 95
Location: Israel
I was wondering what are my options with v3.0.5 to pass a page field recursively to a macro from a template, e.g. if I have PageB which is under PageA, and PageA has ClientID defined which PageB doesn't I want the macro PageB's template is calling to have that value as a paramer.

Please advise - let me know if any clarifications are required.

Itamar.
drobar
Posted: Sunday, September 21, 2008 10:13:59 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Here's how you can use XSLT to get a field recursively...

http://forum.umbraco.org/yaf_postst2751_XSLT-Tip--Display-a-field-recursively.aspx

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Itamar
Posted: Tuesday, November 11, 2008 4:55:51 PM
Rank: Devotee

Joined: 10/30/2007
Posts: 95
Location: Israel
Thanks doug, only noticed your reply now, due to the stupid mailing component this forum uses...

Itamar.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.