$rx.location.generate

Hi,

Please could someone explain the purpose of the “additional signature”, six parameter version of the generate() method of the $rx.location object? I’ve checked the PDF manuals, and the Javadocs, and the best I can find is the following:

$rx.location.generate
Returns String
Used in Templates and Location Schemes
Additional signature of the $rx.location.generate function that allows the user to specify the data used to generate the URL.
[ul]
[li]templateinfo String The Page Template to which the URL will point.
[/li]> [li]item Node The target Content Item to which the URL will point.
[/li]> [li]folderPath String The Folder location to which the URL will point.
[/li]> [li]filter String The Item Filter to use when generating the URL.
[/li]> [li]siteid Number The ID of the Site to which the URL will point.
[/li]> [li]context Number The publishing Context for which to generate the URL.
[/li]> [/ul]

The templateinfo and item parameters make sense. They are presumbly the same as used in the one and two parameter versions of this method. But I’d really appreciate explanations of the other parameters and/or examples of values you’d use for them, and why you would use such values?

We are wondering if this will help us with issues we have when a content contributor adds an item to a slot which is belongs to another site. Will the above allow us to generate “external” links to other web sites managed by the same Rhythmyx server?

Thanks,

Andrew.

This signature was added for use by the publisher.

The other parameters are:

folderpath is the complete folder path “//Sites/mySite/some/folders/here”

filter is the name of the item filter to apply, eg: “Publish” or “Preview”.

siteid is the numeric id of the site: 302

context is the numeric id of the context. This should match the delivery context in the content list definition. If you have only one context, the value is 1.

This should not be necessary for cross site links, which should happen automatically when the site id property of the relationship is different from the original site. As the site id property is set from the display format, one has to be quite careful in how the original link was added to the slot.

I hope this helps

Dave

Hi Dave,

Thanks for the additional info. But I still cannot get it to work. Replacing $rx.location.generate($sys.assemblyItem) with the following, in the bindings of the snippet tempate we use for the majority of our links to items in slots…

$rx.location.generate('cmsPgExtPerson',$sys.assemblyItem,'//Sites/External/ISIS/People','preview',308,1)

…causes the preview to fail with a “Transaction rolled back because it has been marked as rollback-only” message. Looking at the console while it does this, it dumps huge amounts of stuff into the console log - page after page of HTML, Java errors, etc.

But what I most want to know is: what is the purpose of specifying the folderPath? And can it be any folder? The documentation says it is “The Folder location to which the URL will point” which probably means something really obvious to you, but is rather cryptic from my point of view.

Thanks,

Andrew.

If anyone has any clues as to what specifying the folderPath in the six-parameter version of $rx.location.generate enables one to do, over and above what the two-parameter version allows, it would really help us make some decisions on how we share content between our web sites.

Thanks,

Andrew.

All that folderpath does here is identify the correct folder in case the item is in more than one folder.

As I’ve stated earlier, this signature was added to make content list generation easier. You probably should not be using it in Assembly code.

Dave

Thanks for the clarification.

Andrew.