MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Language parameter for WebParts  (Mono Support )

Viewed 26159 time(s), 5 post(s) 8/20/2014 1:45:43 PMby Zoomicon

Related topics

Zoomicon

Zoomicon

8/20/2014 1:45:44 PM

can a WebPart in a Greek say page take a hardcoded parameter for the language it will use?

e.g. in the blog list page there is a sidebar with recent posts and in non-English pages (can check which ones are non-English by parsing the URL for /lng/xx-XX that is different from /lng/en-US easily, or check the "lng" URL parameter that your rewrite rules use if I've understood correctly from recent discussion we had in this forum) we want to show both the list of recent posts for the localized blog and an extra section under it with the list of recent posts from the English blog

to do that we'd pass a hardcoded language parameter to that WebPart, but is there such a thing?

This content has not been rated yet. 
2793 Reputation 345 Total posts
khorvat

khorvat

8/27/2014 8:36:13 AM
Right now all WebParts that are language aware take the current thread language and do the rewriting automatically. You could try to change the functionality of the current WebPart to fix the language or to dynamically switch language depending on your rules.

In order to extend the functionality for e.g. Blog post list you need:

- Inherit from the "~\MonoX\ModuleGallery\Blog\BlogList.ascx"
- override the "Hashtable ParseTemplateTags(BlogEntity blog)" method
- after calling the base.ParseTemplateTags(blog); you need to find the "<# Link #>" tag and amend the URL for that blog post.

Let me know if you need more information regarding the implementation for this WebPart or any other.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
Zoomicon

Zoomicon

9/6/2014 8:51:07 PM
it would be nice if a language (override) parameter was added to your base webpart in the future
This content has not been rated yet. 
2793 Reputation 345 Total posts
mzilic

mzilic

9/8/2014 10:51:33 AM
Hello Zoomicon,

Can you please post this suggestion to the RoadMap forum so that we can keep a track of all suggestions. Thanks.

Regards
This content has not been rated yet. 
2218 Reputation 300 Total posts
Zoomicon

Zoomicon

9/11/2014 9:57:08 AM

Hi, posted the suggestion regarding the language override parameter for webparts below, together with another related suggestion (on how to include/exclude content from the page based on current language or other state like whether user is logged in or not, or some generic test condition, or combination of more of one checks using AND [with possibly some way to define if you prefer OR or XOR instead])

http://www.mono-software.com/Mono/Pages/Discussion/dtopic/XIBURLpYTUOLOKOjACs3tQ/Language-override-parameter-for-WebParts/

This content has not been rated yet. 
2793 Reputation 345 Total posts