I have an HTML widget in the after-content section which will be displayed on 7 pages out of 12. I was reading up on it but didn't find anything except people mentioning rules, I went through the documentation and looked at using "or" rule with url("~/page1") like url("~/page2") or url("~/page3") so on. Will this not show all widgets on all pages? i just want to show one html widget at the bottom of many pages.
Thanks,
Adil
You should create a new layer "MyNewLayer" and then add your rule(s) there. Then, place the widget to be shown on this layer.
Related
I am new to Orchard and question myself how to mix up widgets and content. As of my understanding, the page content type has one layout where you put all your content in: HTML, images, et cetera. Where it will get displayed is defined by the theme. By placing widgets into the zones of the theme I can display custom modules in addition.
But, what if I want (for one specific page, from top to bottom)
Content/HTML -> Widget -> More Content/HTML -> Another Widget -> Even more Content/HTML?
I know it is possible to achieve that by placing the second and third content block into a widget and configure the layer to match the url of my page, but this seems to me like a hack.
In DNN you can place everything, HTML as well as modules, into the exact container/zone you want. In nasty Joomla! you can "import" modules (widgets) as part of the HTML of an article.
What is the way to achieve that mix up in Orchard?
You have tagged the question as orchardcms-1.10 so you should be able to do it.
Orchard has a module called Orchard.Layouts which provides the functionality that you are describing.
Are you using an upgrade old version?
If you have upgraded your site from an older version of Orchard then it will still just have the old style BodyPart as its main content editor. Fresh installs will have LayoutPart which can provide these kinds of complex layouts.
For an introduction on this subject look at IDeliverable's Orchard Layouts intro article.
If you are working with an old upgraded version please add a comment and I will explain the upgrade process.
Have you enabled the Layout Widgets module / feature?
If you already see this but can't add the widgets then make sure you enable the Widget Elements feature:
Go to:
Admin panel
Modules
Type widget into the filter at the top
Click Enable on the Widget Elements feature
Now when you go back to the layout editor you will see a new category with all the widgets placeable as elements.
I have Orchard 1.7 setup with blog recipe.
The home screen display a list of blog posts.
I want to override the way the content is displayed in summary view. I could do this for each parts. But my styling is such that I need to wrap title, body, and meta tags with a special div when ever the display type is summary.
The problem is:
After shape tracing I understood that the template used in the home page (summary) is same as the detailed one.
Content.cshtml
For detail view I want to use the default core-> Views/Content.cshtml but for summary I need to supply my own. How can I do this?
OR
How to write a driver/widget to the home page. I know how I can do this for parts/fields/modules but I don't have an idea on how to create a driver for Blog home page.
Whenever I add a widget to the homepage the default blog post list still get displayed.
Just create a file called Content.Summary.cshtml in your theme. This will target all summary views, so if you have more than just blog posts on your site you will probably want to have Content-BlogPost.Summary.cshtml.
I wrote a small blog post on Item templates in Orchard if you are interested... http://arkleseizure.net/what-the-hell-is-an-item-template
I have a custom theme, the footer, header & home page are all working.
I have a main navigation that links to 5 pages.
I now need to set the style for these 5 pages - and the other pages that link from them (it's different to the home page) - one section of which needs an additional navigation menu on the left (main nav is top).
Would I do this in Visual Studio - or can it be done through the admin web interface?
What is the best approach?
Thanks.
You can add an additional navigation widget on a layer that is not the homepage. As for styling differently on different pages, you could do that many ways.
For example, you could check if the page you are loading is the homepage and load some styles to overwrite the default ones. That would be the easy way I suppose.
If you need a whole new layout for the homepage, you could check out this module on the gallery which lets you select a different layout to use for each content item. Never used it myself, but looks like it could be cool :) http://gallery.orchardproject.net/List/Modules/Orchard.Module.Downplay.Orchard.LayoutSelector
Is it possible when editing a content page to have a text box for Content, BeforeContent, and AfterContent?
I would like to break up my articles into sections such as introduction, core, and summary so that each part gets styled differently in the Layout.cshtml. The only way I can think to do this is to create a layer for each content page then add html widgets for the BeforeContent and AfterContent zones that I would put my introduction and summary in. This seems like alot of extra work.
Sure, add fields and set-up placement for them. Widgets will work too but it will be more painful to maintain. If not almost impossible.
I'm trying to create a theme in orchard. I have a main content zone and a sidebar zone which is on the right of my main content area (2 column layout). The main content area displays a list of blog posts (including tags, etc. Standard Orchard behaviour).
In the sidebar I would like to display the recent blog post widgets. However, the standard widget renders tags, published date etc. I do not want to display this information in the sidebar zone.
The placement file does not seem to be the right place to configure this as I can't specifically target the Parts_Tags_ShowTags shape in the sidebar zone. Neither does it seem to be possible to create a new template like Tags.ShowTags-Sidebar.cshtml
Any suggestions on how to modify/hide a shape in one zone on a page but not the other?
You can either use an alternate (shape tracing can help with that) or take this over entirely (see this post for details: http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx)