Replies: 5 comments 6 replies
-
I'm not sure about your request but in the third screenshot above you are displaying code that should render a BlogPost while you are talking about an IndustryNews Content Type. Here, I think there is a mistake in the code. So here if you had a Content Picker on the BlogPost Content Type that allows you to select a IndustryNews content item you would do something like : var selectedIndustryNewsContentItemId = blogPost.Content.YourContentPickerFieldName.ContentItemIds[0]; Then you would need to retrieve the Content Item related to that ContentItemId from the Content Picker va industryNews = await Orchard.GetContentItemByIdAsync((string)blogPost.Content.YourContentPickerFieldName.ContentItemIds[0]); |
Beta Was this translation helpful? Give feedback.
-
I need a title instead of content item I'd I.e Industry News need to
display?
…On Tue, 1 Feb 2022, 4:38 am Jasmin Savard, ***@***.***> wrote:
I'm not sure about your request but in the third screenshot above you are
displaying code that should render a BlogPost while you are talking about
an IndustryNews Content Type. Here, I think there is a mistake in the code.
So here if you had a Content Picker on the BlogPost Content Type that
allows you to select a IndustryNews content item you would do something
like :
blogPost.Content.YourContentPickerFieldName.ContentItemIds[0]
—
Reply to this email directly, view it on GitHub
<#11108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHWC4ZBWKKJUJKGEBEVYKTUY4MQ5ANCNFSM5NGODPXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Can u please share with me the example I unable to achieved.
…On Tue, 1 Feb 2022, 11:13 am Jasmin Savard, ***@***.***> wrote:
The example above should get you the industryNews content item. Then use
it to display its TitlePart.
—
Reply to this email directly, view it on GitHub
<#11108 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHWC442EBYGV6CUKJCL22TUY522LANCNFSM5NGODPXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I used in razor syntax I still get the content item Id instaead of title
part?
…On Tue, 1 Feb 2022, 12:12 pm Jasmin Savard, ***@***.***> wrote:
[image: image]
<https://user-images.githubusercontent.com/3228637/151926610-29f03c72-113f-4ea7-95ba-eeb18e6b77a2.png>
And here is the result :
[image: image]
<https://user-images.githubusercontent.com/3228637/151926660-fc2f5508-8e5d-4dfd-beaa-47325d4336b0.png>
—
Reply to this email directly, view it on GitHub
<#11108 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHWC4YFZ5UKVH62VZRN45TUY6BVJANCNFSM5NGODPXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
@saleemhaq I see you are using liquid syntax incorrectly in TitlePart, for
Because it generates empty - the default value assigned to CotenteItem.DisplayText will be content item id. If you don't need field then simply enable "Render Title" and set title as editable in setting Also when you use content picker, in another content item, it will only store ids and you have to query as suggested by @Skrypt var selectedIndustryNewsContentItemId = blogPost.Content.YourContentPickerFieldName.ContentItemIds[0] as string;
va industryNews = await Orchard.GetContentItemByIdAsync(selectedIndustryNewsContentItemId);
// here is the title
var title - industryNews.DisplayText |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I created new post and link like that:
still i got the same contentid instead of title:
I used the razor pages anyone please help me on above please look into this: #11055
Beta Was this translation helpful? Give feedback.
All reactions