6

I am using the Dynamic Placeholders from Fortis, but need to setup a page template where the Dynamic Placeholders contains renderings. I am setting the page template up, by setting layout detail on the standard values of the page template.

I have been unable to succeed in this, since the dynamic placeholder is postfixed by a GUID which is generated. Is there a way to predict this GUID? According to the documentation, the GUID is generated using the following logic:

Dynamic Placeholders simply use the rendering ID to create a unique placeholder name. If more than one dynamic placeholder with the same name is in a rendering it will also append on an incrementing number

I tried another approach, by using a home brewed dynamic placeholder library, which just prepended the dynamic placeholder with a sequential number, e.g. row1, row2, row3. But this approach makes the content editors unable to move rows in the experience editor, since the content inside the row is tied to a fixed number, which changes when the rows are moved.

Disclaimer: This is posted at stackoverflow as well.

1
  • Please don't double post.
    – Mark Cassidy
    Sep 16, 2016 at 11:02

2 Answers 2

10

You can try to open the standard values item with the Experience Editor and add the renderings you like.

If that doesn't work out, create an item based on the template, add the renderings and manually copy the values over to the standard values item.

2
  • That is an excellent idea. I will try it out and return with a verdict.
    – AndreasPK
    Sep 16, 2016 at 10:25
  • It worked without any complications! Thanks a lot for the suggestion.
    – AndreasPK
    Sep 19, 2016 at 8:14
3

This is an alternative to the method mentioned by Thomas D.

The Fortis solution uses the UID for the rendering attached to the placeholder key that you enter. You can get this by changing to Raw Values view and copying the xml out of the renderings or final renderings field.

Find the rendering that contains your placeholder. There will be an xml element like this:

<r id="{CA76EB6F-2934-4B8A-BB6A-508A8E44A7C5}" 
   ph="body" 
   uid="{0FD41EBD-43CF-4647-8A0F-F1F1D2E00CCD}" />

There may be other fields too. The 2 that are important are id, which is the item id of your rendering item and uid, this is the unique rendering id that is added to your placeholder key.

The key is built like this: string.Format("{0}_{1}", placeholderName, renderingId);

So if you have a placeholder key called title, the key for the above xml snippet would be: title_{0FD41EBD-43CF-4647-8A0F-F1F1D2E00CCD}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.