[opencms-dev] Locale macro in XSD schema

Christoph Fröhlich cfauto at folge2.de
Mon Feb 18 15:59:28 CET 2013


Am 18.02.2013 um 15:23 schrieb Paul-Inge Flakstad <flakstad at npolar.no>:

> ...
> 
> It's way more simple than writing a custom widget.
It seems that you are right :(

c


> 
> Best regards,
> Paul
> 
> -----Original Message-----
> From: Paul-Inge Flakstad 
> Sent: 18. februar 2013 12:39
> To: 'Arturo Martín Lladó'
> Subject: RE: [opencms-dev] Locale macro in XSD schema
> 
> Hi again Arturo,
> 
> I'll stick with the example I provided - a list of news articles with category filters.
> 
> In the news article's XSD, the category element has this configuration:
> <layout element="Category" widget="CategoryWidget" configuration="onlyleafs=true|property=category" />
> 
> By setting a value for the "category" property on a VFS resource (typically a parent folder of the appropriate content - in the example case this would be the "news" folder), you can control what categories are available in the category widget when editing news articles.
> 
> In the example, the property value would be "theme/" (without quotes).
> 
> The value "theme/" is a reference to the (category) folder /sites/default/__LOCALE__/_categories/theme/, which is the parent category of all the categories visible as category filters in the news list. By setting this value, the category widget for news articles will contain only these categories. Other categories will not be available.
> 
> You can of course also omit setting any value on the "category" property. In that case, all categories that are available for the path of the resource you're editing will also be available in the category widget.
> 
> Hope I was able to explain this, please let me know if anything is still unclear. :)
> 
> Cheers,
> Paul
> 
> -----Original Message-----
> From: Arturo Martín Lladó [mailto:arturo.martin.llado at gmail.com]
> Sent: 18. februar 2013 12:13
> To: The OpenCms mailing list
> Cc: Paul-Inge Flakstad
> Subject: Re: [opencms-dev] Locale macro in XSD schema
> 
> Hi, Paul:
> 
> Are you able to offer (with your categories taxonomy) a CategoryWidget dialog using this kind of configuration?
> 
> <layout element="CategoryExample" widget="CategoryWidget"
> configuration="category=/__LOCALE__/_categories/Example/"/>
> 
> Obviously, __LOCALE__ (and with this, the category under the user would search) must change when the user tries to edit the content using another locale.
> 
> I believe the problem would be the same, both using /__LOCALE__/_categories/ or /_categories/__LOCALE__ as configuration value.
> 
> Regards.
> 
> 2013/2/18 Paul-Inge Flakstad <flakstad at npolar.no>:
>> Hi Arturo,
>> 
>> Sorry I'm not answering your question per se, but I'm just curious; *must* your categories be organized like /sites/default/_categories/__LOCALE__/?
>> 
>> We do have a multi-language site and use categories, but have organized them this way: /sites/default/__LOCALE__/_categories/. To me, this seems to be the most convenient approach.
>> 
>> The downside:
>> The categories must be defined separately for each locale. In our case 
>> the category folders must have identical names, to enable easy 
>> switching between languages. (So in other words, everything should be 
>> identical, except for the Title property.)
>> 
>> The upside:
>> It works like you want it to (I think). The categories are localized to the correct language both in the widget when editing pages and on the screen when viewing the site.
>> 
>> A live example from our site:
>> http://www.npolar.no/en/news/. Category filters to the right. Language switch next to the site search (the flag icon).
>> 
>> Cheers,
>> Paul
>> 
>> -----Original Message-----
>> From: opencms-dev-bounces at opencms.org 
>> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Arturo Martín 
>> Lladó
>> Sent: 15. februar 2013 14:27
>> To: The OpenCms mailing list
>> Subject: [opencms-dev] Locale macro in XSD schema
>> 
>> Hi, list.
>> 
>> Is there available any locale macro for using it in XSD schemas?
>> 
>> I'd like to do something like this:
>> 
>>        <layouts>
>>                [...]
>>                <layout element="Categoria" widget="CategoryWidget"
>> configuration="category=/_categories/__LOCALE_MACRO___/tipoDocumento/|onlyleafs=true"/>
>>        </layouts>
>> 
>> This is because our categories tree is organized this way:
>> /sites/default/_categories/__LOCALE__/...
>> 
>> Kind regards.
>> 
>> --
>> Arturo Martín Lladó
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list To change 
>> your list options, or to unsubscribe from the list, please visit 
>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>> 
>> 
>> 
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list To change 
>> your list options, or to unsubscribe from the list, please visit 
>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>> 
>> 
>> 
> 
> 
> 
> --
> Arturo Martín Lladó
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
> 
> 
> 

-------------------------------------------------
Christoph Fröhlich
Folge 3 GmbH
Neuer Pferdemarkt 1
20359 Hamburg

+49 +40  79 69 48 78
cf at folge3.de
http://www.folge3.de
-------------------------------------------------
Geschäftsführer: Christoph Fröhlich, Anja Künzel
Handelsregister: HRB 105806, Amtsgericht Hamburg 







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130218/a71c1e63/attachment.htm>


More information about the opencms-dev mailing list