Paschalis Posted January 19, 2016 Share Posted January 19, 2016 Hi all, i want to have a field where i will paste only URL links from external pages. I want this to be treated like facebook: after, when i will save it, it will be in my page as title, image, description and a target: _blank link to go in the external page where i cut it Thank you in advance Link to comment Share on other sites More sharing options...
rick Posted January 19, 2016 Share Posted January 19, 2016 Something similar to this url preview feature? 1 Link to comment Share on other sites More sharing options...
Paschalis Posted January 19, 2016 Author Share Posted January 19, 2016 exactly like this my friend Link to comment Share on other sites More sharing options...
rick Posted January 19, 2016 Share Posted January 19, 2016 First, welcome to the forum. There are many ways to accomplish goals in ProcessWire, so I'm sure others will submit additional info, or a completely different solution. Probably the simplest method to start with would be to create a text field to hold the desired URL, and reference that page field in your code as the usage section describes on the github preview site. $preview_url = new LinkPreview( $your_page->your_field ); $parsed_url = $preview_url->getParsed(); etc... Also, that solution on that site is not the only solution available, as this functionality has been a fairly common request for a number of years. So you might want to search around for an option (e.g., jquery) that may better fit your needs. 1 Link to comment Share on other sites More sharing options...
DaveP Posted January 19, 2016 Share Posted January 19, 2016 Also take a look at http://oembed.com/ and http://modules.processwire.com/modules/textformatter-oembed/ 3 Link to comment Share on other sites More sharing options...
rick Posted January 19, 2016 Share Posted January 19, 2016 Also take a look at http://oembed.com/ and http://modules.processwire.com/modules/textformatter-oembed/ I like the textformater module. Link to comment Share on other sites More sharing options...
DaveP Posted January 19, 2016 Share Posted January 19, 2016 (edited) I like the textformater module. It hasn't been updated for a while, but the author, felix, is still around. <edit> And just thinking out loud, it wouldn't be hard to make a text formatter to cURL a link and parse for Open Graph tags or Twitter Cards, which a lot of sites include.</edit> Edited January 19, 2016 by DaveP 1 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