Gazley Posted September 6, 2012 Share Posted September 6, 2012 Hi there, I want to link to pages in the site from within TextAreas (eg: Body copy type fields). In code, I might output a link using a $page->url value. I've seen the PageLinkAbstractor module and whilst I superficially understand what its use-case is, it doesn't seem to be for exactly what I'm trying to achieve. I think I am wondering how I can simulate getting the results of a page find() into a link without having to manually type the href value into the HTML. If it's a manual process and that's how it's done, then so be it. However, if there is a best practice around this, I would be keen to understand how others link to site based pages from within site-copy text areas. Thanks! 1 Link to comment Share on other sites More sharing options...
diogo Posted September 6, 2012 Share Posted September 6, 2012 You can do it in tinyMCE. Just add a link normally, and choose the option "link to page" on the dialog 1 Link to comment Share on other sites More sharing options...
Gazley Posted September 6, 2012 Author Share Posted September 6, 2012 OMG! That's fantastic! Thanks for pointing it out to me Link to comment Share on other sites More sharing options...
diogo Posted September 6, 2012 Share Posted September 6, 2012 You're welcome! By the way, the PageLinkAbstractor module prevents the links to be broken when you move your pages around. Link to comment Share on other sites More sharing options...
Gazley Posted September 6, 2012 Author Share Posted September 6, 2012 With regard to your original suggestion, does the link's href get resolved at run-time or by selecting the target page in TinyMCE, does it just literally embed the path as a string so, no dynamic find() call at runtime? Link to comment Share on other sites More sharing options...
diogo Posted September 6, 2012 Share Posted September 6, 2012 The links break when you move a page, so, I guess it's not dynamic at all. Have a look at the readme.txt of PageLinkAbstractor, it might give you some clues https://github.com/ryancramerdesign/PW2-PageLinkAbstractor Link to comment Share on other sites More sharing options...
ryan Posted September 7, 2012 Share Posted September 7, 2012 Anything in TinyMCE text is pretty much raw HTML, so I've tried not to introduce any other factors into that in order to ensure the portability of the content. However, the PageLinkAbstractor module (soon to be replaced by LinkMonitor) does convert them to/from page ID references, so that links don't get broken when you move a site to another subdir or move an individual page. The disadvantage of PageLinkAbstractor/LinkMonitor is that because the link data is then abstracted, your content is no longer portable. If you ever uninstall the module, any links it has abstracted will then be broken. There's also a small amount of overhead associated with converting links to/from abstractions on the fly, but I think it's a worthwhile compromise for most. You might also want to look at the PagePathHistory module (included with the PW core). This keeps track of page moves and maintains redirects when a page is accessed at an old URL. 1 Link to comment Share on other sites More sharing options...
Gazley Posted September 7, 2012 Author Share Posted September 7, 2012 Thanks for the further clarification Ryan. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now