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 guys,
I want your help because I'm going crazy...
I have the following block code in my template:
if(@CurrentPage.HasValue("secondaryOfferImage")){ secondaryOffer.ActionButtons = new ActionButtons() { Desktop = new ButtonItem() { Caption = @CurrentPage.secondaryActionButtons.ActionButtonDesktop[0].caption, Link = @CurrentPage.secondaryActionButtons.ActionButtonDesktop[0].link, OpenNewWindow = @CurrentPage.secondaryActionButtons.ActionButtonDesktop[0].newWindow }, Mobile= new ButtonItem() { Caption = @CurrentPage.secondaryActionButtons.ActionButtonMobile[0].caption, Link = @CurrentPage.secondaryActionButtons.ActionButtonMobile[0].link, OpenNewWindow = @CurrentPage.secondaryActionButtons.ActionButtonMobile[0].newWindow }, ActionName = @CurrentPage.secondaryActionButtons.ActionButtonNameNativeApps, ActionLink = @CurrentPage.secondaryActionButtons.ActionButtonLinkNativeApps }; secondaryOffer.Title = @CurrentPage.secondaryTitle; secondaryOffer.Description = @CurrentPage.secondaryDescription.ToString(); secondaryOffer.OfferImage = @Umbraco.Media(Convert.ToString(CurrentPage.secondaryOfferImage)).Url; }
Everything worked perfectly until I decided to move the last three lines over the secondaryOffer.ActionButtons, that is, the code was as follows:
if(@CurrentPage.HasValue("secondaryOfferImage")){ secondaryOffer.Title = @CurrentPage.secondaryTitle; secondaryOffer.Description = @CurrentPage.secondaryDescription.ToString(); secondaryOffer.OfferImage = @Umbraco.Media(Convert.ToString(CurrentPage.secondaryOfferImage)).Url; secondaryOffer.ActionButtons = new ActionButtons() { Desktop = new ButtonItem() { Caption = @CurrentPage.secondaryActionButtons.ActionButtonDesktop[0].caption, Link = @CurrentPage.secondaryActionButtons.ActionButtonDesktop[0].link, OpenNewWindow = @CurrentPage.secondaryActionButtons.ActionButtonDesktop[0].newWindow }, Mobile= new ButtonItem() { Caption = @CurrentPage.secondaryActionButtons.ActionButtonMobile[0].caption, Link = @CurrentPage.secondaryActionButtons.ActionButtonMobile[0].link, OpenNewWindow = @CurrentPage.secondaryActionButtons.ActionButtonMobile[0].newWindow }, ActionName = @CurrentPage.secondaryActionButtons.ActionButtonNameNativeApps, ActionLink = @CurrentPage.secondaryActionButtons.ActionButtonLinkNativeApps }; }
What the hell ?! :|
Hi,
I think its the '@' symbols.
you don't need them when you are assigning values - the '@' is short hand razor is using to write out to the page, as you are assigning things you can/should remove it.
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
template weird behaviour
Hi guys,
I want your help because I'm going crazy...
I have the following block code in my template:
Everything worked perfectly until I decided to move the last three lines over the secondaryOffer.ActionButtons, that is, the code was as follows:
What the hell ?! :|
Hi,
I think its the '@' symbols.
you don't need them when you are assigning values - the '@' is short hand razor is using to write out to the page, as you are assigning things you can/should remove it.
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.