Hi Everyone, I have a question abut the
y
Hi Everyone, I have a question abut the Contentment Package !!! I am trying to use Contentment to create a Data List by language, but it not show me the other languages, it only return the English content because it is the default language ! any solution?? how can I send the language? the current language ? https://cdn.discordapp.com/attachments/882984798719729704/1199992711818784869/Screenshot_2024-01-25_095440.png?ex=65c48f4d&is=65b21a4d&hm=a341c72809e1a63199f4f38ac864e9bb3c40cea0fc300ded48670cb7cac7fb35&
l
Hi @Yasein H. Burqan. I'm not sure what your
/CMSProperties/GetPropertySliderNormalNews
API controller code is doing, so can't really give much advice on how to handle that. At a guess, you could try
CultureInfo.CurrentCulture
? 🤷 You may be better to write your own custom
IDataListSource
, docs are here: https://github.com/leekelleher/umbraco-contentment/blob/develop/docs/editors/data-list.md#extending-with-your-own-custom-data-source That way you may be able to access any other querystring parameters that are being used when the content properties are being generated. e.g.
cculture
or
mculture
? (I'm not entirely sure on the name).
y
Hi @leekelleher , I am trying to get the contents , the news that I created, but I want to git by labguage
@leekelleher At a guess, you could try CultureInfo.CurrentCulture? 🤷 exactly
@leekelleher cuz when I call the API I can not git the current language, so any way to send the language with API?
l
Not really, as the JSON data-source doesn't attempt to manipulate the URL you give it at all. e.g. https://github.com/leekelleher/umbraco-contentment/blob/4.6.0/src/Umbraco.Community.Contentment/DataEditors/DataList/DataSources/JsonDataListSource.cs#L242 If it was to start passing through extra parameters, then it'd need to parse the URL and update accordingly... and things like querystring parameter name clashes, it would get messy (and I don't need the maintenance headache). Which is why I recommend developing your own custom data-source, then you have full control (rather than piggybacking the JSON data-source).
y
@leekelleher That mean You do not know everything about your code, I will do it after that I will tell you the solution.
3 Views