开发者

How do I use custom fields in hyperlinks?

Would anyone know how to link the custom field to a page that lies 4 segments deep?

<td valign="top" align="center">Hotels:</td>
<td valign="top">{toursRelatedHotels}{title}{/toursRelatedHotels}</td>

I would like to link the {title} of the Hotels field, Im finding it hard to do so.

The way I am doing it is as follows

开发者_运维问答{toursRelatedHotels}<a href="{title_permalink='destination/{toursRelatedCountries}{url_title}{/toursRelatedCountries}'}">{title}</a>{/toursRelatedHotels}

It seems that the url_title cannot be seen of the country in the link. how else can I do this?


I usually build sites with the (commercial) add-on Structure, which allows you to easily use a {page_url} tag pretty much anywhere and avoid numerous url depth issues.

http://buildwithstructure.com/


Could you give us a bit more info, or maybe include the full template code? Are you trying to access the url_title of the related entry, or the parent entry?

ExpressionEngine can be a bit funny when you are trying to show information about related entries. Often the best thing to do is to embed a new template inside your related entries loop.

{toursRelatedHotels}

{embed="template_group_name/template_name" hotel_id="{entry_id}"}

{/toursRelatedHotels}

Have a look here for more info - http://expressionengine.com/user_guide/templates/embedding.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜