Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Adding Experience Fragment to Page

mark_julianp181
Level 2
Level 2

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

3 Replies
edubey
Level 10
Level 10

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

mark_julianp181
Level 2
Level 2

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

s1101v
Level 3
Level 3

@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.