2

Is it possible to get HTML link of individual fragments/contents present in a page of a site built on SDL? Mainly looking for approach to render a SDL Component directly by URL.

These links would be used for surfacing assets (like header/footer/banner etc.) built using SDL, to be re-used in non SDL sites. For e.g. if I have a SDL Tridion Page consisting of header, footer, and banner as a main content. Looking for ways to get HTML link of the individual fragments present in the page like header, footer, banner, in this case.

4
  • 3
    Perhaps you could share an example of how you expect to use these links? Are you simply considering having them as SSIs for example? Tridion manages Page Linking [1] and Component Linking [2] which may be relevant (there's also DCPs [3] too); but just because you can do something, doesn't mean you should - I really believe giving a little more context will serve you better [1] docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/… [2] docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/… – Dylan .. Mark Saunders Apr 25 '17 at 13:01
  • These links would be used for surfacing assets(like header/footer etc.) built using SDL, to be re-used in non SDL sites. Is it possible to get HTTPS link of individual fragments of the components in SDL? Can ComponentLink be used to generate a html link for accessing the content externally? – Shipra Apr 25 '17 at 14:39
  • If you want the external links then you want links to the fully rendered HTML; Tridion can supply this in many ways and it matters of which version you have but essentially one example is to a link through ODATA, you could mask that by a redirected URL to make an ODATA request and reformat it - I'd be interested to hear what you've actually tried and/or read thus far? – Dylan .. Mark Saunders Apr 25 '17 at 16:39
  • Thanks! Customers using Tridion may be on different versions so, looking for a generic approach of giving ability to bring the content to non-SDL sites that would work across versions. But if each version has different approaches for getting external link, that should be fine too, so far, it is possible to get a link. – Shipra Apr 25 '17 at 17:12
1

We recently shared our header and footer to a different website of our client which was non SDL. But lots of the thing came to be out of the box in DXA. e.g Header and footer are separate pages.

so it was easy to share those as Ajax or Link via exposing some new actions. but had to maintain the absolute URL(s) of the images, links. also CORS challenges.

2
  • Raj, Thanks for the info. How did you get the HTML link of header/footer in SDL? Is it possible to retrieve a HTTPs url of component? – Shipra Apr 25 '17 at 16:38
  • Yes, that why its was called using Ajax. again it was in DXA. – Raj Kumar Apr 27 '17 at 9:53
1

If the fragments are component presentations, then standard component linking can allow you to link directly to the component presentation in the page. See the documentation here.

If it's a question of linking to a header or footer, or other standard part of your page, then just add the relevant id in the HTML

<div id="header">

and link to that with a fragment identifier. Obviously, you'll need to take care of ensuring that ids are unique in the page, but for headers and footers, that should be simple.

1

An HTML page published by an SDL Web CMS, is after that fact nothing more than an HTML page, so there is no further API to get parts of that page, other than possible Dynamic Component Presentations on that page (which you can access though the Content Delivery API, see http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/GUID-7EC91BB9-707C-493D-8AA2-7E6414A307A8)

At current SDL Web doesn't yet have region support for pages, which means there is no way to group content in a region, and retrieve it as such. Which is why for DXA we have chosen to use Pages for this. If you look at http://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v7/GUID-FEAEBD6E-0F6F-4DFB-8D9C-AB1704FFFADA and http://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v7/GUID-5E88B1FC-FA9A-46F0-B7A5-89FCF058DB23, you find information about how we are using Pages as includes for specific reagions in our web application. This concept is probabaly the best and easiest approach you can currently use if you need to include fragments of Pages in an external web site/application.

There is region support on the backlog of SDL Web, so in the (near) future you can expect more support around this, but for now I would say your best bet is using the same approach as DXA does for its include Pages.

1

Based on your text and then your comments you seem to be thinking of content within the CM and content as published by the CM as 'the same thing'.

You don't get the links from "Tridion" but Tridion is used to create the output that then resides in a published format; be that a database, a web service or traditional, physical files (and these could be static HTML, JSP, .Net, PDF or other!).

So it seems what you're looking for is the final URL of the page - or if you want to get the Component Presentations then the ODATA URL etc.

I think you really need to improve the question to give more clarity on

1) What you require and 2) Your current understanding of Tridion

Perhaps you can include a diagram to show how you currently put together the header/footer/page content, how it's then published, how it's currently requested and responded to by an end user?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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