Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

View Template – Image with custom hyperlink

$
0
0

Hi,
I can see that you can use "View Templates" to create items for display made of 2 or more fields joined together.
The example you give here creates a hyper-linked image by joining the "main-image" with the "post url":
http://wp-types.com/documentation/user-guides/using-a-view-template-in-a-view-layout/
The code used for the "View Template" is:
<a href="[wpv-post-url]">
[types field="main-image" width="290"][/types]
</a>

I have that working but I'd like to have an image that links to a custom URL. I've tried:
- Create a custom field called "tpsurlsl" (Type:"Single Line") and add the custom URL data to the relevant post
- Use the wpv-post-field in the template view, instead of the code above:
<a href="[wpv-post-field name="tpsurlsl"]">
[types field="main-image" width="290"][/types]
</a>

When I try saving it, the system strips out the link code and leaves just:
<a>
[types field="main-image" width="290"][/types]
</a>
So I guess there must be something wrong with the way the link is constructed. What would be the right way to build it and code the template view?

Thanks


Viewing all articles
Browse latest Browse all 20145

Trending Articles