Adding Experience Fragment to Page

Avatar

Avatar

mark_julianp181

Avatar

mark_julianp181

mark_julianp181

15-04-2018

Hi,

Is there any way to add an experience fragment to a page dynamically using HTL or get requests?

I keep getting forbidden when trying to access experience fragments using get requests like in the code below :

     function getFragment(path) {

            $.ajax({

                type: 'GET',

                url: path,

                success: function(xf) {

                    $("#article-container")

                        .append(xf);

                }

            });

        }

Regards,

Mark

Replies

Avatar

Avatar

edubey

Avatar

edubey

edubey

16-04-2018

You need to make sure correct read access for that path based the current user who is trying to access XF

Avatar

Avatar

mark_julianp181

Avatar

mark_julianp181

mark_julianp181

16-04-2018

I have access to the experience fragments and I am not having the same problems with content fragments.

Avatar

Avatar

s1101v

Avatar

s1101v

s1101v

03-07-2020

@mark_julianp181  - I am looking for similar solution to load the XF content based on the drop down selection, In the JCR node, I have only the reference path of the XF variation only. Not sure how to get the complete DIV of the XF to replace the content on the page. Please provide your inputs if you have already implemented this solution.