Jump to content

Recommended Posts

Posted

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:

processwire.jpg

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

Posted

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.

  • Like 1
Posted (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 by DaveP
  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...