[Gelöst] Share links to posts but substitute the domain.
Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.
Problem: I would like to create a link to share my post. The link should act like a "mailto" link, opening the email editor with some prepopulated information about the post in the mail body.
Solution: You can add parameters and shortcodes to the mailto link URL to set any HTML you want in the message. Designing that template will require custom HTML and CSS.
Hi, there's nothing built in to Toolset that will automatically filter link URLs like this. Depending on the URL structure and post type, you might be able to create links manually with HTML and Views shortcodes, like this:
Actually Christian that totally worked!! I massaged it a little to remove the post-type in the URL but otherwise, fantastic!.
Now, if I wanted to turn this into an actual 'share' type function - how would I make this mainto:... Also, can I put this behind an image instead of displaying the name of the post?
Now, if I wanted to turn this into an actual 'share' type function - how would I make this mainto:...
You want to create a mailto link that puts the destination URL in the message of an email, if I understand you correctly. You can do that by appending the "message" URL parameter to the email address, like this:
<a href="mailto:someone@something.com?message=Check out this post: [wpv-post-url]">[wpv-post-title]</a>
Also, can I put this behind an image instead of displaying the name of the post?
Yes, you can replace the text inside the link tag with an image tag, something like this:
<a href="mailto:someone@something.com?message=Check out this post: [wpv-post-url]"><img src="<em><u>versteckter Link</u></em>" alt="[wpv-post-title]" /></a>
I suppose I would prefer to provide a more formated message with the contents for some custom fields. Am I getting into an area that is beyond the scope of Views?
You're getting into an area that requires some advanced knowledge of HTML and CSS, because Views isn't designed for visually formatting HTML emails. That's tricky business, even for experienced developers, because different email systems have different rendering engines that interpret CSS slightly differently. Views shortcodes can be placed in the mailto URL message parameter, so in theory you could use a WYSIWYG field to build an HTML email message. Then insert the WYSIWYG field in the message parameter of the mailto attribute. However, the overall display of the email is completely based on your own custom HTML and styles.