Nested Content w/ Dynamic Parameter Asset Listing

Quick background: I have built a nice interface for our campus departments to use that allows them to easily build a department newsletter using CKEditor, ajax, triggers etc. This allows them to build their newsletter, upload a main image, choose a design etc, and send out the bulk mailing all from a nice interface. That said…


I have a design that uses a nest_content design area:


    
        
    


This then nests an asset listing that has dynamic parameters, set to the current asset, looking one level down for an image. Doing this sees the image under the parent Standard Page and nests it in the parent page.
Example: http://www.puc.edu/academics/departments/visual-arts/newsletters/department-newsletter-2009?SQ_DESIGN_NAME=blue
(It also nests a second asset listing that looks up the tree for a parent that lists the department name)

It all looks fine when I preview it normally and it looks how we want. The problem arises when the bulkmail is sent out, as the nest content area and asset listing is looking at the DESIGN asset for the dynamic parameters rather than the standard page that the design is applied to. So, it is looking one level down on the design asset and seeing a PUC Logo that I have linked there, which, totally screws up our email design and is not what we want. Here is what it looks like when it gets mailed:

[attachment=409:Picture 3.png]

As you can see, it is using the design asset for the dynamic parameters. It is finding the first image under the design and listing that. But, it can't find a Redirect Asset 2 levels up, so it can't list a name for that, as you can see.

So, I am wondering, is this a bug? I was depending on this working, as we told all departments we would have this ready soon. So, this is the last part of the puzzle that I need to get working.

Thanks! Picture 3.png (62.3 KB)

Nic


It would seem that the design area knows nothing of the page on send, dynamic replacement relies on knowing where you are browsing at the time so previewing and browsing all work but sending the mail and what is sent may not work. I am sure a Matrix dev can shed some light. I would have thought the listing would retreat to the root node though and not the design asset, where was the root set?. Is there any way you can catch the asset id of the page they create and set it in a get var when they send and use the session var on the listing for the dynamic replacement?



Shane

[quote]
I would have thought the listing would retreat to the root node though and not the design asset, where was the root set?. Is there any way you can catch the asset id of the page they create and set it in a get var when they send and use the session var on the listing for the dynamic replacement?

[/quote]



Shane, I understand what you are saying about when it gets sent it does not know nothing of the page. But, I would have expected that Matrix would handles situations like this.



The root node is set to our main site.



I am sure there are alternatives like the ones you described (session var sounding the easiest), but I just wanted to understand, from a Devs point of view why this is not working. For all I know, this could have been fixed already, since we are running 3.18.8.

Nic

[quote]Shane, I understand what you are saying about when it gets sent it does not know nothing of the page. But, I would have expected that Matrix would handles situations like this.[/quote]



I have worked with Matrix for a long time now and still get caught expecting things to work a certain way. [quote]I am sure a Matrix dev can shed some light.[/quote]


[quote]I am sure there are alternatives like the ones you described (session var sounding the easiest), but I just wanted to understand, from a Devs point of view why this is not working. For all I know, this could have been fixed already, since we are running 3.18.8.[/quote]



Again, I am with you, it would be awesome if a Matrix dev would get involved with some info. I have several solutions for clients that I have had to work hard to get around situations just like this one, which is where the passing a get to session var came from. I am mostly working in 3.18 versions and one 3.22 version. I do know that there has been improvements around passing variables through the nest content container in later versions like better keyword replacement in the get variables that can be passed so it would be good to get a dev perspective on whether this is also the case for the nest content design area. Still weird that it rooted to the design asset though.

When a bulkmail sends, it sends from the server via the run.php script. It has no URL while running on the server. This stops all functionality working that relies on using the current URL, or cookies, to determine context.


The functionality you are relying on is lineage. This is functionality normally provided by the design asset when it is first loaded, allowing pages to determine the current asset and its lineage up to the site. Without a URL, the lineage is unclear because it could be one of many.



I expect that some very core changes to the way context (and especially lineage) is determined could be made to get this going for you, but they will require development.



If you can find any ways around this, abuse them! But remember that the bulkmail has no URL, no query string and no session when run via that run.php script. But the vars passed into nested areas are set by the PHP code and not inferred from the URL or session, so they will continue to work even when running on the server.

[quote]
If you can find any ways around this, abuse them! But remember that the bulkmail has no URL, no query string and no session when run via that run.php script. But the vars passed into nested areas are set by the PHP code and not inferred from the URL or session, so they will continue to work even when running on the server.

[/quote]



So using a session var is out of the question…



I guess I will see what my options are tomorrow…I will post back here when I get a solution.


Nice to see you loosening up a little Greg:)

[quote]But the vars passed into nested areas are set by the PHP code and not inferred from the URL or session, so they will continue to work even when running on the server.[/quote]

Nested asset design area doesn't have the ability to pass any vars. Nic, can you set a paint layout on the page to do the nesting rather than the design? I am sure that you can conjure up plenty of shenanigans in the paint layout to do what you want.

[quote]
Nested asset design area doesn't have the ability to pass any vars. Nic, can you set a paint layout on the page to do the nesting rather than the design? I am sure that you can conjure up plenty of shenanigans in the paint layout to do what you want.

[/quote]



Arg, you are right. Yeah, I will have to go the paint layout route…

As long as you don't suffer another Matrix eccythump…

[quote]This stops all functionality working that relies on using the current URL, or cookies, to determine context.[/quote]



Be good to see how you get on with this one.

[quote]
Nested asset design area doesn't have the ability to pass any vars.

[/quote]

Yes, sorry, I was talking about the nested areas in the page contents, which are actually called Content Types and not areas. My bad.

I was just thinking. The quick and dirty route for this is to just stuff everything into the assets metadata.


I can return the created images URL at creation time, and just set that __data url as a metadata text field. It won't really matter, since the mailing is a once time thing, and we won't ever delete the image, so it will always keep that public path. And, for the Department name, I can just add that to the asset builder at time of the page creation.



That will be much easier. Definitely not as elegant, or Matrix like, and I would never do it in any other situation. But, I think for this it fits and will be the quickest and easiest route.

Hey guys,


Just using metadata worked quite well. So, I think that will be my solution for now.



Thanks.