After having followed the instructions to "unabridge" blog posts in Orchard, I'd now like to separate the blog post date and comment-count, so that the date appears ahead of the blog post, and the comment-count appears after. How would that be done?
Even better, I'd additionally like to have the comment-count be a hyper link to the blog post detail. How would that be done?
To do this and many other similar things, you should enable shape tracing (it comes as part of the designer tools module). This will show you what template is rendering what, and also where they are positioned. It will also tell you what templates you can create in your theme to override behavior. The Model tab in particular will show you the whole model object graph and will give you the expression to put in your template to include any property into your markup.
Related
I need to build a comments section on my apostrophe for users to be able and leave comments/feedback around content that someone will create in pages. That would require to create collections in the database as well as allow users to comment only but not to remove any the module/widget. Also, comments need to, of course, be linked to pages.
Not really sure, how I can approach this task. Whether, to build a separate microservice or a widget to handle this. I have read the tutorial for building a contact form in apostrophe, also tested. However, I don't really need to have an option on the Admin Bar as comments are linked to each page, I need the form to be static (don't want any users to remove them or add more than one on a single page), also want the comments to appear below the form once they have been submitted.
Any idea of how I can do this?
Thank you for your time.
Dcram
EDIT
Well, before I needed to do this for pages and I even managed to post the comments specific for each page where it should be. However, needed to make a few changes on my site and now this comment widget appears in pieces like blogposts! However, haven't being able to display the specific comments for each piece. Is there any way I can find the piece page url similar to data.page._url so that I can compare with the one attached to each comment?
Thanks!
We almost always use Disqus for this purpose, but if you need a commenting functionality that is internal to your site, there is the apostrophe-pieces-submit-widgets module that can be extended for this purpose.
You would definitely want the comments to be an instance of an apostrophe-piece in the docs collection, which would mean it would by default be included as an item in the admin bar. Easy enough to hide that, however.
Following this pattern would result in creating / configuring 3 project-level modules:
comments - extends apostrophe-pieces, defines the comment piece type
comments-widgets - extends apostrophe-pieces-widgets, a widget to display comments on a template (you could also hard code this behavior into a template instead of making it a widget)
comments-submit-widgets - extends apostrophe-pieces-submit-widgets, a widget to display the front-end form that users use to submit their comments
Building this sort of functionality directly into a piece and its widget player is not too difficult, check out this project for more
https://github.com/stuartromanek/apostrophe-comment-system
Steps:
Checkout project / install / create user / get up and running
Create a Comment piece from the admin bad (Home Page Comments, for example)
Add the new piece to singleton widget on the homepage
Comment!
This code should give you a pretty clear guide for creating backend functionality that can be interacted with on the frontend.
Permissions for interacting with the widget itself should be managed through apostrophe-permissions http://apostrophecms.org/docs/tutorials/intermediate/permissions.html
I asked this question over on the Kentico devnet but haven't had a definitive answer.
I have a particular requirement for a Kentico 8.2 implementation where in code, given a specific TreeNode, I'd like to find first all the zones on the template being used then, for each zone, get the details of all web parts and widgets used in those zones.
In my case I do not need to worry about template inheritance. None of my pages implement template inheritance.
I found this post on the old Kentico forums which suggested I might be able to do use PageInfoProvider to get a PageInfo object for the relevant TreeNode then use its PageTemplateInfo property to gain access to what I need.
However, I don't see a PageTemplateInfo property of CMS.DocumentEngine.PageInfo. There is DesignPageTemplateInfo and UsedPageTemplateInfo. I thought maybe UsedPageTemplateInfo would be the one, and it does indeed include the correct zones in its WebPartZones collection. But I don't see the web parts (actually, widgets) I'm expecting in the zones' WebParts collections.
I guess what I'm asking is, how can I use API to gain access to the content of the DocumentWebParts column from dbo.CMS_Document as a structured object? I've realised I can get access to the information I need by calling .GetProperty("DocumentWebParts") on TreeNode, but this is unstructured XML. I presume somewhere in the API I can get this information as a structured object.
Does anyone know how I might access the details I need? Thanks.
P.S. My template uses the ASPX+portal model.
As I mentioned in my second answer on the DevNet, you cannot specifically use the cms_document table simply because webparts function within templates and not with a specific page. Widgets on the other hand are specific per page even if the page has the same template as another page. Take a look at the example on the DevNet I provided, it should get you what you're looking for.
I am fairly new to Orchard, really impressed with what I have seen so far.
My question:
I have a site that uses blogs fairly heavily as content. On the homepage, there are the following widgets:
'featured' - a blog post that has a featured field (query)
'latest' - a list of blog posts, sorted by date (blog archives)
The featured post will have an image heavy design (while hiding things like post time/number of comments/tags/etc) while the latest posts will be a fairly traditional layout (showing the aforementioned fields). As such, these widgets, which are the same base type, need to have very different structures.
I have figured out how to access the individual widgets, the overall blog post and each of the individual parts of the blog posts, however I cannot figure out what level I should be creating a view at, to be able to style these individually.
At the content level, I have a reasonable amount of control (still reliant on the #Display(Model.Content) though) however, none of the alternates I can see in Shape Tracer will allow me to ONLY change the Content-BlogPost.cshtml (or similar) for the particular Widget or Zone (both would allow access).
What I really need is to be able to specify the zone AND the content area. (something like Zone-ZoneName-Content-BlogPost.cshtml)
Am I missing something important? or am I going about this completely wrong?
Any help would be greatly appreciated.
Regards,
Nick
(apologies for cross posting from codeplex, has been a few days and I really need to progress)
You know, the publishing suite offers other content than forum. for example blogs and also some custom content
i know how to add articles/widgets to the page itself, but how do i add such a thing into a forum secion?
for example, on the left column i would have forums and on the right column i would have some news reader widget
could someone help?
Maybe it is enough for you to enable the "forum sidebar" in the admincp.
admincp->Settings->Options->Forum Sidebar and Block Options->Enable Forum Sidebar=YES.
Now you can add custom blocks with HTML and PHP.
For vBulletin 3.x, the solution is to edit the appropriate templates (FORUMDISPLAY, SHOWTHREAD, etc). I can't be much more specific than that, I'm afraid, since the exact details will vary depending on what kind of modifications you've already made to your templates and the exact details of the widgets you wish to insert.
A client is asking to incorporate commenting on their news articles. They're using the Sharepoint news site template for their news publishing, etc. They want a simple commenting system, much like what is available on most blog engines, only they want it at the bottom of each news article.
I just thought I would ask around about an out of the box solution before I go quoting a custom dev solution. Thanks in advance!
I struggled with this a while back and the solution we found was to use a discussion borad list (out of the box) and we created a custom web part that we added to the page layout for news.
We had to do som trickery to add support for anonymous comments, but on the whole it works good and wasen't to much code.
The Community Kit for SharePoint does the whole commenting thing for blogs.
you may have to cut out the commenting part of it to get it to work with your news section however.
The commenting section of the Enhanced Blog Edition of CKS does to approval of comments and spam checking.
I had the same request. I didn't find an existing solution, so I did it by copying from the standard Blog site template, plus custom coding.
From the template: Copy the definition for the blog comments list. Remove the lookup fields, and use a feature to create the list on all publishing sites.
Custom code: Add a feature receiver to the comments feature, and use it to add the lookup fields for page id and title, (using the pages list as destination). This needs to be done in code because you can't configure the destination list for lookup fields in XML, (or at least I don't know how).
Write controls for querying the comments list and adding to it, and place on the page layout.
Simpler approach: Don't use the standard blog comments list, just create your own, where the page reference is just a number and not a lookup field. Pro: Less work. Con: You miss out on the views that come with the standard list.