I'd like to insert in my view the Post Title as title or alt of the image as SEO wants 🙂 but when i try to do it in html, it doesn't show me the image
How do you output the types field? You can double check the Types fields API and the parameters with examples from our site - https://toolset.com/documentation/functions/
I use this:
[types field="immagine-ristorante" alt="alt immagine" title="title" width="300" height="300" proportional="true"]
But i'd like to use this:
[types field="immagine-ristorante" alt="[wpv-post-title]" title="[wpv-post-title]" width="300" height="300" proportional="true"]
When i use the second it gives to me a strange output... it outputs the image but the alt"" is the URL of the image... and some addictional html in the body after the image like this:
title=??Post title?? width=??300″ height=??300″ proportional=??true??]
WordPress doesn't support inner shortcodes by default. We have a custom implementation that allows the usage of [types] and [wpv-post-field] shortcodes inside other shortcodes such as galleries but we have limited the capability for performance reasons. I will see if it is possible to add more extensions for future versions.
Ok Mario Good! It should be very useful for SEO purpose to have dynamic titles!
There is another way i can do it now?
For now you can use a custom field for the title and use it with the shortcodes inside shortcodes: https://toolset.com/2012/02/views-0-9-4-adds-taxonomy-views-conditional-html-and-other-goodies/ (scroll down to that chapter).
We will probably implement these for the next release but would take a couple of days so can't promise an immediate reaction.
All the best,
how can i use the classic html code and retrive the img src url ?
i'd like to try to insert this type of code:
<img src="[types field="logo"]" alt="[wpv-post-title]" title="[wpv-post-title]" width="203" height="287" />
It could be very useful to set image title using a custom post type because they shouldn't have the same in all posts that uses that template view