Hint to migrate my existing website to Orchard

Topics: General
Feb 20, 2015 at 3:09 PM
Hi to all, in these days I'm exploring Orchard and I'm wondering if there are some hints or guides to migrate an existing website to Orchard.

One of the first problem I'm facing is how to split existing html pages in zone.
Can someone suggest me a good starting point?

Thank you in advance for your help.
Best regards
Feb 21, 2015 at 9:55 AM
Essentially you'd be writing your own theme. A good starting point would be reading the documentation (section Creating Themes) and study the TheThemeMachine theme that comes with Orchard.

Let us know if you have any specific questions.
Feb 21, 2015 at 1:25 PM
Thank you sfmskywalker , I've read one possibile starting point is to create a custom theme (done) , create the Layout view and paste the static html code in (done) after this step , I have to change some parts to be dynamic with Orchard ...... For instance the main menu is a list of <a> tag I must transform each link in a menuitem but , after pasting the static html code the zone disappear from my code and using shape tracer nothing is detected. Even the link o the Admin console. Can you help me to proceed in this activity ? Thank you again for your help.
Best regards
Feb 21, 2015 at 3:10 PM
After pasting in the static HTML, it is time to add back the zone rendering instructions.

For example, in Layout.cshtml:
<div class="container">
   <h1>My website title</h1>
   <div class="content">
Notice the instruction @Display(Model.Content) - that renders the Content zone.
Similarly, you could render a zone for navigation, footer, asides, etc. Anything really that makes sense for your site that you want to contain dynamic content.
Feb 21, 2015 at 4:05 PM
Perfect , thank you , if I'm not wrong I must add Content Zone in Theme.txt file, is it correct? Thank you again for your precious help.

Feb 21, 2015 at 5:02 PM
That's not strictly necessary. You only have to list the zones in Theme.txt if you want those zones to appear on the Widgets page in the dashboard.
Feb 24, 2015 at 9:49 AM
Edited Feb 24, 2015 at 9:50 AM
Thank you again sfmskywalker, with your suggestion I'm going on, now I'm facing a little problem with html editor TinyMCE, I'm trying to insert an html widget in the header zone and, when I try to insert the following syntax in the HTML editor
<div id="logo"><a href="#"><img src="@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, "/Content/images/logo.png"))" alt="" /></a></div>
the output html is
<div id="logo"><a href="#"><img src="@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, " content="" images="" logo="" png="" alt="" /></a></div>
I'm googling around and it seems to be a setting of TinyMCE editor but I can't find it.

Could you help me ?

Thank you again for your precious help.

Best regards
Feb 24, 2015 at 4:12 PM
As far as I know it is not possible to write razor code in tinyMCE because it will never parsed .
If you want to add an Image to your header and you want do it with an HTML widget I would upload the Image with the MediaLibrary and add the image in tinymce. In this case you get the correct path of the image.