I recently did the same thing, but instead of writing JCR queries I used the ContentUtil.collectAllChildren(Content content, Content.ContentFilter filter) method. Worked fine as well.
Nils. ________________________________________ Van: [email protected] [[email protected]] namens Will Scheidegger [[email protected]] Verzonden: dinsdag 16 februari 2010 20:55 Aan: Magnolia User-List Onderwerp: Re: [magnolia-user] Question on links Sure. How is that link stored a) in a nodeData by itself using a "link" control b) in a nodeData by itself using a "uuidLink" control c) somewhere in the content created by a "fckEdit" control What you do is you let the target page query the whole website tree for nodes pointing to itself. For case a) this could look like so: - target page at /path/to/targetpage - nodeData containing the link called "link" - query: "SELECT * FROM nt:base WHERE link = '/path/to/targetpage' For case b) the query could look like this: - target page uuid is abcd-1234-efgh-5678-ij90 - nodeData containing the uuid of the linked page called "linkedPageUUID" - query: "SELECT * FROM nt:base WHERE linkedPageUUID = 'abcd-1234-efgh-5678-ij90' For case c) fckEdit stored both the handle (path) and the uuid in the text, e.g. like this: <a href="${link:{uuid:{f0ac0fe9-62cd-4892-ada2-33d9cd43fa5a},repository:{website},handle:{/path/to/targetpage},nodeData:{},extension:{html}}}">Click here</a> If you decide you should want to search for the uuid (what I would do), things could work like this: - target page uuid is abcd-1234-efgh-5678-ij90 - nodeData containing the html code which somewhere contains the uuid of the linked page called "text" - query: "SELECT * FROM nt:base WHERE CONTAINS(text, '%abcd-1234-efgh-5678-ij90%') Cheers, -will On 16.02.2010, at 19:31, [email protected] wrote: > > Assuming i have a paragraph with an internal link to a page, is there any way > from the other page to collect all the links pointing to? > > Tx fof any advice > > Luca > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/home/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- > ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ---------------------------------------------------------------- De informatie vervat in deze e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan. ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
