Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Im trying to check if a page node existing when using the content picker data type. So if a page is deleted, then the link is not outputted.
Any help would be grateful.
Martin
@inherits Umbraco.Web.Mvc.UmbracoViewPage <div> @Umbraco.Field(Model, "callToActionContent") @if(Model.HasValue("callToActionButtonLink")){ var button = Model.GetPropertyValue<IPublishedContent>("callToActionButtonLink"); <div class="btn"> <a href="@button.Url">Contact »</a> </div> } </div>
Hi Martin i think you should do something like this
@inherits Umbraco.Web.Mvc.UmbracoViewPage <div> @{ var button = Model.GetPropertyValue<IPublishedContent("callToActionButtonLink"); } @if(button != null){ <div class="btn"> <a href="@button.Url">Contact »</a> </div> } </div>
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Check if ID is still valid in content picker
Hi,
Im trying to check if a page node existing when using the content picker data type. So if a page is deleted, then the link is not outputted.
Any help would be grateful.
Martin
Hi Martin i think you should do something like this
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.