Skip Navigation

[Resolved] Media attached to a Content Template used in multiple Views

This thread is resolved. Here is a description of the problem and solution.

Problem: If I add media from the Media Library to a Content Template, will that media work in multiple Views, or will I have to upload the media to each View?

Solution: When you insert Media into a Content Template, the system generates an image tag with a hard-coded image URL. As long as that item exists on the server, the image will appear across multiple Views that use the same CT.

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Ben 5 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1191512

Ben

If I have a Content Template with media included and I use this Content Template across multiple Views, should I have to upload the media individually to each View for it to work? Or does the media from the Content Template "transfer" across also?

I'm sure there was a bug in which you can see all WordPress media when editing a Content Template so I want to make sure that this is nothing to do with it before I use this method.

#1191691

Hi, I assume you have some media file (like an image) uploaded in the Media Library, and you plan to insert that item in a Content Template by using the Media button to insert the appropriate shortcode. If that's correct, then you don't need to upload the Media in each View. The Media button will generate an HTML image tag to display an image, for example:

<img src="<em><u>hidden link</u></em>" width="300" height="121" class="size-medium" />

As long as this image exists in the Media Library and the URL doesn't change, the same referenced Media file will be loaded anywhere the Content Template is loaded, regardless of the current View or current post. Let me know if I've misunderstood your question.

#1192086

Ben

That is exactly what I meant Christian. Thank you for confirming!

The ability to add any media from the Media Library in a Content Template is a bug according to Beda so I am a bit worried that when this is patched, that all media inserted this way and not directly "uploaded" to each Content Template would break and not be functional. But this is not the case?

#1192194

The ability to insert any existing media in a CT may change in the future, but it shouldn't affect the image tags that have already been placed by the Media button. They are hard-coded into the content, not as reference to some media item. Once you insert media this way, it's not going to be stripped out at a later time by a change to the insertion system unless you manually remove it from the content, then try to reinsert it. At that point, you may need to go to the actual Media Library, copy the media item's URL, and insert your own HTML tag in the Content Template manually.

#1199463

Ben

Thank you for all your help with this Christian!