I want to show the Author in Blog Post In OrchardCms.but I don't know how to do this.can anyone help me please?
(As always in Orchard, ) You have multiple options for this. The simplest one would be to create an alternate for the Content-BlogPost.cshtml, and put in something like:
# {
var commonPart = Model.ContentItem.As<ICommonPart>();
var userName = commonPart.Owner.UserName;
}
<h1>#T("Author"): #userName</h1>
The best way to achieve this, is by adding new part called AuthorPart, and attach it to BlogPost type. This link is a tutorial from Orchard site on how to create new part and build the display for it:
Related
I want to define a new template called "product".
This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to do that has been found here.
However, I would like that the URL of the page would be something like:
/product/<id>/<seo-friendly-description>
So I can retrieve in the Twig template both <id> and <seo-friendly-description> which will be used later to retrieve the specific product information.
I have tried to find something that could help in the documentation, without success. Could someone either point me to the right doc section or highlight the basic steps that shall be achieved so I can start solving this issue?
Just in case it helps, I am trying to find something similar to how bottle or other web frameworks work:
#route('/hello/<name>')
def greet(name):
return 'Hello ' + name
I've been building a family recipebook into my own website and I've been working through a similar problem. I haven't quite worked out all the kinks, but my solution is mostly working if you want to checkout my github repo.
In short, you need the plugin to watch what the active route is. If the route matches, you then create the page and populate it using your plugin data.
I haven't quite figured out how to get the active page to highlight in the navigation menu for generated pages, but you might still find this solution helpful.
I want to create and customize a form in Liferay-7, and I really don't know how to make it , because i can't modify the liferay standard form.
Any idea about how can I start?
What I want to create :
Thank you .
This looks pretty much a basic form and you just need a different layout set. Following this documentation here. This should help you in building the form you need.
I am new to Orchard CMS may be this can be easily achievable I don't know how to do it exactly as i have searched a lot on Google. I have a blog where I need to display the archive in drop down Eg :
I checked the blog module and I don't know how can I filter it so that I can get this. Do I have to create a new module to achieve this or a tweak in the Blog module will work. I Read the sky-walker tutorial to understand how to create a module but i don't know how to achieve this.
You need to override the Parts.Blogs.BlogArchives.cshtml, very easy. That is what Orchard is all about. you can read more about it in the documentation.
Check this Accessing Shapes , for starters.
I am beginner to Orchard. My purpose of starting this discussion is, to make beginners aware about Orchard Fundamentals.
I am currently Developing on web site using Orchard. But most of the times I am facing difficulty in rendering contents and how to place content on front end. As well, use of content items, content types and modules. Usually, I get confuse in using all these things. For example : I have created new content type for displaying latest post on my site, with date and user's profile picture. So for that my question is, "Is it right that I have created content type for it? or should I have to make module? and if yes than can I use my content type as a widget on my homepage? "
FYI: I went through the documentation and plural sight's video. But I was not able to clear above fundamentals.
Sorry for any inconvenience or any stupid questions, but at this time it seems bit complex for me. Can anybody please help me to clear my fundamentals of orchard?
Thank you,
Sohil Shah
I am currently Developing on web site using Orchard. But most of the times I am facing difficulty in rendering contents and how to place content on front end. As well, use of content items, content types and modules. Usually, I get confuse in using all these things. For example : I have created new content type for displaying latest post on my site, with date and user's profile picture. So for that my question is, "Is it right that I have created content type for it? or should I have to make module? and if yes than can I use my content type as a widget on my homepage? "
Is it right that I have created content type for it? or should I have to make module?
Sure, a ContentType just means that you can create instances of that specific type through the CMS.
or should I have to make module?
Do you want to re-use your contenttype across different projects? If so, then you should create code that creates the contenttype for you (in a migration script) and put that in a module.
can I use my content type as a widget on my homepage?
Yes, you need to enable your contenttype to be a widget. You can do this also with a migration script like so (add the WidgetPart and settting Widget stereotype:
ContentDefinitionManager.AlterTypeDefinition(
"MyWidget",
x => x.WithPart("WidgetPart")
.WithSetting("Stereotype", "Widget")
);
I'd like to have a hierarchical URL structure in my site. Something on these lines:
tutorials
javascript
jquery
There should be a page at each level (tutorials, tutorials/javascript and tutorials/javascript/jquery). Obviously, using Taxonomies would help me organize my content in this manner, but how do I get Autoroute URLs generated for this scenario?
Bertrand Le Roy made a comment on this SO answer about using taxonomy terms as pages but it still doesn't seem to create the right URL structure for me. Am I missing something? Is there something specific I need to configure or enable to make this happen?
Are there any other approaches I can look at?
I was thinking of specifying the default route as something like {Content.Fields.Page.TaxonomyName}. It appears that this isn't really possible right now according to this bug report.
Here's an approach that seems to work without having to use taxonomies:
I added a Content Picker field called ParentPage to the Page content type and updated the Page's Autoroute default to
{Content.Fields.Page.ParentPage.Content.Path}/{Content.Slug}
Now in each page I get to pick what the parent page is and the URL is constructed how I expect it. From what I remember of working with WordPress, I think this is pretty close to how it allows you to do this parent page thing, too.