I want to add an image from the media library into my master template. I found this thread which provides a solution on how to do this (5th post) however that doesn't really solve my problem.
I would like the image to be editable, so the user can upload a new image to overwrite the existing one. If they upload an image with a different name however the solution in the above thread wont work as the path will be different.
How can I add an image into a template by using it's ID.
If you check that thread Dirk (2nd post) shows you how you can use some inline xslt to use on your masterpages. I think it's the 3rd example you will need. You just have to change the field to the name of the content picker.
The image isn't a page property though so there is no content picker name. I created a media node and uploaded the image directly in the media section.
Well if you want your image to be editable then I would suggest putting a media picker (sorry not content picker) on one of your doc types. This will then allow a user to upload an image to the media section without overwriting the old one.
I think the image may be required on more than one page though :/ If not then I'll use a media picker but in the meantime I've made an xslt macro to output the image.
If you need it on more than one page then, depending on your sites structure, you could add it as a property to your home page and then use recursive="true" on the field in the template.
In this case you would need to structure your site like this:
Content -Home -AboutUs -Services ...
This would also allow you to add a property to the Services document type with the same alias as the one on the home page and if gets set it will override the one defined on the home page.
Showing an image in a template
I want to add an image from the media library into my master template. I found this thread which provides a solution on how to do this (5th post) however that doesn't really solve my problem.
I would like the image to be editable, so the user can upload a new image to overwrite the existing one. If they upload an image with a different name however the solution in the above thread wont work as the path will be different.
How can I add an image into a template by using it's ID.
Hi Suzyb
If you check that thread Dirk (2nd post) shows you how you can use some inline xslt to use on your masterpages. I think it's the 3rd example you will need.
You just have to change the field to the name of the content picker.
Ben
The image isn't a page property though so there is no content picker name. I created a media node and uploaded the image directly in the media section.
Well if you want your image to be editable then I would suggest putting a media picker (sorry not content picker) on one of your doc types. This will then allow a user to upload an image to the media section without overwriting the old one.
Ben
I think the image may be required on more than one page though :/ If not then I'll use a media picker but in the meantime I've made an xslt macro to output the image.
If you need it on more than one page then, depending on your sites structure, you could add it as a property to your home page and then use recursive="true" on the field in the template.
In this case you would need to structure your site like this:
Content
-Home
-AboutUs
-Services
...
This would also allow you to add a property to the Services document type with the same alias as the one on the home page and if gets set it will override the one defined on the home page.
Ben
is working on a reply...