Tell us what you are trying to do? We have a related article sections where are displayed related posts called from their ID.
see: hidden link in the ARTICOLI DI URBANFILE tab section.
Since we created a subdomain on another hosting the referenced articles are not working anymore because they take the actual subdomain (file.orbanfile.org) instead of the original domain (blog.urbanfile.org)
Is there a way to create a correct view of related posts that belong to the other domain?
Hi, if all the related posts are "Schede" posts, then you can use the post slug shortcode to create links to the other domain like this:
<a href="<em><u>hidden link</u></em>;">[wpv-post-title]</a>
Modifying the custom field image URL isn't so simple. You could edit each post and update the image URLs manually, or you could use the PHP API to manipulate the custom field values using custom code.
add_filter( 'wpv-post-field-customfield', 'ts_switch_domains_customfield_field', 20, 2 );
function ts_switch_domains_customfield_field( $out, $meta ) {
$out = "<em><u>hidden link</u></em>";
return $out;
}
Documentation for this API is available here:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv-post-field-name
Hi Christian and thanks for your prompt reply, what we need to achieve is reference a post that is not a custom post made with Toolset but a normal post, so I suppose we cannot use the shortcode methos. What we need to achieve is retrieving the post data (title, feature image, and post URL and display it in Toolset view). The author that populates the content actually just need to place the post ID but the problem is that the referenced post is a clone of the original site, created in this new environment, so we just wanted to avoi post duplication.
As you know is there a way to retrieve some post data from another domain and then populate the view of the custom post in that way?
Another workaround we thought maybe possible is to let the page load the post with the wrong third-level domain, then without refreshing the page add a sort of Javascript that replace in all URLS of the DIV ID="news" the string file.urbenfile into blog.urbanfile, do you think it would be a good idea?
Hi Christian, I came up with another idea but I need your assistance since I am not able tu create all elements with Toolset.
The workaround could be to create a repeatable group of fields that contains (post title, post image and post URL). All those data can be inserted manually by the editor but we need to know how to create that repeatable element inside the custom post and then how to display the results of all inserted elements in a view.
Hope this description is crear enough. We tried to create a group of fields but it is not repeatable and so we don't know if it is possible.
Thanks for your help on this. Maybe this solution is much easier also for the editors when they populate the custom post with data.
Franco
As you know is there a way to retrieve some post data from another domain and then populate the view of the custom post in that way?
No, Views is not designed to read external data sources. It only reads information in the current site's database.
Another workaround we thought maybe possible is to let the page load the post with the wrong third-level domain, then without refreshing the page add a sort of Javascript that replace in all URLS of the DIV ID="news" the string file.urbenfile into blog.urbanfile, do you think it would be a good idea?
I'm not sure I'm the best source of information about that, sorry!
we need to know how to create that repeatable element inside the custom post and then how to display the results of all inserted elements in a view.
We have a guide to creating and displaying repeatable field groups here: https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
Feel free to open a separate ticket to discuss repeatable field groups (RFGs) in more detail.