Development of Orchard's Multilingual Website

Orchard 1.10 adds multilingual

1.添加localization module。

2.enable content localization。

3.Add the required language in the setting.

 

4. In the module, many cultureswitchers and culturepickers cannot be used, and the language select widget cannot be displayed.

Later, I tried a PVlt localization module, and finally the widget came out.

 

5. Add a culture layer module, which is used to control the rules in the layer. Lang("zh-cn") can be used to distinguish languages.

 

6. Add the Theme of PJS.Bootstrap, the compilation fails at first, see https://github.com/psenechal/PJS.Bootstrap/issues for a discussion about compatibility with orchard v1.10, and then download the github The latest master branch, after that, the compatibility issue is resolved. When compiling, add a reference to the corresponding orchard package in the theme project. After the compilation is passed, the website can be opened normally, but css and js cannot be imported normally. The orchard of TheThemeMachine in the same directory can be imported with its own theme css.

If there are static files in the directory from google to vs project, create a web.config under the folder. The content is as follows

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

  <system.webServer>

    <staticContent>

      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />

    </staticContent>

 

    <handlers accessPolicy="Script,Read">

      <!--

      iis7 - for any request to a file exists on disk, return it via native http module.

      accessPolicy 'Script' is to allow for a managed 404 page.

      -->

      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />

    </handlers>

  </system.webServer>

</configuration>

See Themes\PJS.Bootstrap\Styles also have this web.config file. Later, it was found that there is also a web.config file under Themes\PJS.Bootstrap\. There is also a configuration referenced by a static file. First change StaticFile to all files path="*".

It still doesn't work. After thinking about it, is it because the web.config is nested, the StaticFile node has the same name? So I changed StaticFile to bootstrapthemeStaticFile. Rebooted and it worked. Both css and js are imported normally.

Prove my conjecture is correct,

1. If the web.config is nested, the StaticFile name cannot be the same.

2. Guess, in fact, just put a web.config in the outermost directory of all the directories that need to be imported, configure StaticFile in it, and configure path="*".

 

  <system.webServer>

    <handlers accessPolicy="Script,Read">

      <add name="bootstrapthemeStaticFile" path="*/Theme.png" verb="GET" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />

      <!--<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />-->

    </handlers>

  </system.webServer>

 

 7. To install featureitemslider, you must first install mediapickerfield. Otherwise the picture selection will not appear. This time, there is also the problem that css files cannot be imported, but each directory with static files also has the above definitions. and more

  <!--<system.web>

    <httpHandlers>

      --><!-- iis6 - for any request in this location, return via managed static file handler --><!--

      <add path="*" verb="*" type="System.Web.StaticFileHandler" />

    </httpHandlers>

  </system.web>-->

一个IIS6的配置。偶尔看到有些网站上面说要把这段给去掉。于是注释掉了上面那段。但是还是不行,

后来发现还有一个目录下面的web.config里这段没有注释掉。注释掉了之后,重新启动,就正常吧css引入了。

 

2016-10-03  测试下来,mediapickerfield还是和orchard v1.10不兼容。当创建带有media picker field的content type之后,再次打开这个content type会报错。 

因为Media和Media Picker两个module是deprecate了的。所有依赖media模块的其他模块如Image Field也不能用,所以弃用 feature item slider了。

安装了一个Mojabi.ImageSliderGallery 1.0 ,他的选择MediaLibraryPickerField,这个是Media Library自带的一个图片选择控件。目前使用一切正常。

 

 

 

 

 8.因为css都是less编写的,而且网页内都是引用的*min.css,所以下载了一个vs2015的插件web compiler 

https://visualstudiogallery.msdn.microsoft.com/3b329021-cd7a-4a01-86fc-714c2d05bb6c

选择less文件,web complie后,自动更新*.css和*min.css。

 

9.projection是一个集合,可以用来显示产品列表,文章列表,projection的数据源是query,可以在query里制定列表数据,query里添加filter,一个是localization,一个是contenttype。就可以过滤到自己想要的数据列表了,projection默认是没有localization的,要在content  definition里add parts,把localization加上去。然后要把projecttion对应到layer上,每种语言个一个layer,要设定rule:Lang("zh-cn") and ContentType("ProjectionPage"),这样就得对于不同的列表情况设定多个projection的contenttype。如ProductProjection等。

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327041898&siteId=291194637