Create a list of pages in Orchard - orchardcms

Lets say for example, I have a list of products that each have it's own page... in what way can I create a single page that will list each product as it's contents as a list (with hyperlinks)? Not really sure how to do this directly in Orchard - or will I need to create a custom page / widget? Thanks for any help... new to Orchard and not sure how to tackle this.

You have a couple options. I believe the Orchard gallery at orchardproject.net has a module called Simple Commerce that may solve your problem. (it's simple so it might not)
(In the following section, I've tried to boldface the terminology words that are 1) are crucial to understanding how to use Orchard and 2) helpful in finding your way around the dashboard)
Another option may be first creating a Content Type--probably one named Product with some Fields describing an individual product. Price, SKU and description come to mind, but you'll be better able to describe your own products. Each Content Type in Orchard can be associated with any combination of Parts. You may have to research which ones you actually want for an individual product, but I'd recommend:
Body (this could replace the Description I suggested above) You could include any amount of HTML/script in this section to make your individual product pages look fancy!
Common (this has to be added when Containable is used)
Containable (this will allow the items to be listed)
Route (so you can link to a specific product)
This gives each product its own slug (URL)
Tags (to allow products to be categorized)
Now, you need to create a new List from the dashboard so you can display the products together (and inherit other features like pagination, etc). Be sure to select the Product Content Type in the Contains drop down list.
Then, you can start creating your Content (your Products) one by one. In the dashboard, click the new Product item and describe each new piece of Content.
Finally, you can link directly to this new List using the Products List's *slug*. You could (and might want to) add the Products List to your main navigation menu. Clicking the Products List and checking the "Show on main menu" box will automagically add a navigation button directly to this page. You could, of course, link to this List from anywhere using the slug (also found on the list's edit page)
This page, from the Orchard documentation pages describes more things you can do with a list of content like modifying the layout of the list, placing content fields in different places and even converting your products to widgets which you could use to display some promotional product offering in a special spot on your site.
I highly recommend reading through at least the documentation provided on the Orchard site to get a good grasp of what this CMS can do out of the box and what you would need to write custom code to accomplish (which you could do in this case, but Orchard can handle it out of the box)
Hope this helps!

Two ways to do this:
http://orchardproject.net/docs/Creating-lists.ashx and http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.Taxonomies

Related

How do I create one to many relations in Kentico 12 page types?

So I have created a page type, for content entry. The first part, 24 fields, sets up some headings and boolean fields that tell whether certain information and or buttons will be displayed on the page. This works fine and I can customize the input form just the way we want it. But the issue is how to now link in some one to many relationships. For instance alternate redirect urls, multiple content paragraphs. The idea is to have the same entry form for products as the users are currently using, the one to many escapes me. I am using the MVC dev end. I have created custom modules and associated web controls, but cannot figure how to add them to the page type layout.
Thanks in advance.
For the module tables to link to page types you need a cross-reference table. This table would hold say a GUID from the page type as well as a GUID from the module table. How you link the page type and module record could be done on the page type (while this would be harder) OR you could create a custom UI module which would allow users to view the linking table and add or remove records. This would be a listing of all the module table records and then allow you to select one module record and see or add many links to it.
Then in your page display, you simply do a custom query to that cross-reference table and join in the module table to get the data you need.
There are many approaches with pros and cons for each.
You can use Related Pages to relate to other pages that contain your content (such as a Page that contains paragraph information). My Relationships Extended Module can help with that.
You can use the content tree to store relationships, putting multiple items below the page and using the NodeAliasPath to find children of your certain page types (DocumentHelper.GetDocuments("My.PageType").Path(YourParent.NodeAliasPath+"/%"))
You can also use a multiple-selector, storing a guid or codename in a comma separated list on a single field (not greatest but it can get it done).
You can also create your own custom binding classes through the Modules, although you will need to make sure to configure things properly with the ObjectTypeInfo so it is handled properly in Kentico. Again the Relationships Extended module can aid in creating interfaces to maintain that.
See RelationshipsExtended
And also My Blog on this topic
And a presentation on different data modeling with pros and cons.

Get listitems from Current Site

I am trying to create a Page Layout, that should have a lookup field. Lookup field should always get populated with a list's items.
This list will exist in all subsites, so whereever I create this page, list should get populated with listitems from current site.
I tried using site column lookup field, but it always point to list under top site and not the current site.
Any suggestion on how to make it work or better alternative? Thanks!
Let me know if I can provide more info.
The most straightforward solution I can think of is using a cross site lookup column and creating a seperate fields for each subsite. However, you will need to create and use different Page Layouts for each subsite.
You can use http://sp2010filteredlookup.codeplex.com/ for cross site lookups.
Solution 1 - Use http://sp2010filteredlookup.codeplex.com/
Use filtered lookup solution. So let's say you have your custom Page Layout and custom Page Content Type.
Every time you create new subsite, you should remember go to Pages list settings and edit Page Content Type by adding cross site lookup (with the same field "internal name").
So you still have one Page Layout (and one Content Type). But for each Pages library instance, Content Type contains diff fields (but with the same Internal Name). It will allow you run CAML queries and other things needed without any problems.
Solution 2 - develop custom sharepoint field type.
In edit mode, control will render "dropdown list" and populate data from list instance that is on current subsite. In the field settings you can have relative list url.
Solution 3 - hidden text field / js snippet solution
Page Content Type can contain hidden text field (it can contains selected field value in json format for example). Develop js snippet that will handle all the logic (rendering in edit/view mode, saving etc) and put it on Page Layout (aspx).
I would suggest to use solution #1 or #2.

Drupal6 - product comparison

Hi
I have not using any shopping cart module, just created a content type (product) and defining several field(attribute) for each product feature.
I want to ask is there any module in Drupal for product comparison or field comparison?
Thanks
No, but there is a way to do it with the Flag module and Views. It will take more work than just turning on a module, but the outcome is the standard product comparison you're looking for. See this article.
The article is no longer online: here the content of the original post.
Ubercart Product Comparison
For me, using Ubercart in Drupal as an e-commerce solution for your website is the way to go. I have been using Ubercart for years now for a number of web design and development projects, and there are a massive amount of contribute modules to beef it up. One feature that I have been keen to work on is a Product Comparison feature, which would allow users to select products and have them display on a page, providing them with a nice and easy layout to easily compare their selected products.
After searching around the web, I found a few articles and posts from people looking for this feature, asking how it could work or if anyone had done it, but couldn’t find anything that said “here it is, this is how it can be done”. So, after a little bit or research and a bit of a play, I have come up with a solution which is not that difficult to achieve and only requires some already existing Drupal modules with just a few tweaks.
Note: This tutorial assumes that you already have a working ecommerce site with Ubercart installed. Best to also try this on a test environment and not a live website.
Step 1. Download Required Modules
Download, install and enable the following modules.
Views (I used 6.x-2.11, I haven’t tested it with any other releases)
Flag (I used 6.x-2.0-beta3, I haven’t tested it with any other releases)
Step 2. Flags configuration – Setting up your “compare”
Once you have enabled the Flags module, go to the flags administration page at /admin/build/flags.
Click the Add link, enter the name of your flag (something like “compare”), and leave the flag type as “node”, and submit.
On the next screen you will need to configure your new flag. Complete the following fields (changing the values if you like). I setup my configuration so only registered users of the website could compare products.
Title – Compare Products
Flag link text – Add to compare
Flagged message - [title] has been added to your compare
Unflag link text – Remove from compare
Unflagged message – [title] has been removed from your compare
Flaggable content – Product
Check “Display login link for anonymous users.” and for anonymous link text add “[login] to add to your compare”
For flag access, check flag and unflag for authenticated users
Under Display options select “Display link on node page” and “JavaScript toggle” as link type
Click submit to save your flag.
With the settings we used, the “flag link text” should now display on your product nodes. Clicking it should make the “flagged message” appear and the link changed to your “unflag link text” using JavaScript.
So what we are doing here is just flagging nodes – it’s actually pretty simple. We are flagging/unflagging them as “compare product”, so you should now be able to (by clicking on the link provided on your products) add and remove products to compare on your website.
Now we have done this, we need to create a page to display our “flagged” products, in which this case is the products we want to compare.
Step 3. Creating out Compare Products Page
Go to the Views Administration page, enabling the Flag module creates a default flag view. You can use this as a reference, or even change this view to what you need, it’s totally up to you. All we need is a view with (at least) the settings explained below.
DEFAULTS
Basic Settings – Use at least the following settings
Title: Product Comparison
Style: Table
Items per page: Unlimited
Access: Authenticated user
Empty text: Full HTML
- You have not yet added any products to compare. Click the “Add to compare” link when viewing a product to add it to this page.
Relationships
Add the following relationship:
Flags: Node flag
- label: compare
- check “Include only flagged content”
- flag: select the flag you created in step 2
- by: current user
Fields – You can put whatever fields here you would like to show up against each product. You must include the Node Title, and ideally you would want to show a thumbnail of the product, its price and description and the unflag link to allow users to remove it from this page. I have the following fields for my compare:
Content Image using an imagecache, linking to product
Node: Title linking to product
Flags: Flag link
- Relationship: select the one you added
Product: Sell Price
Node: Teaser
Filters
Node: Published Yes
AND SAVE
Now add a new page display view and give it a URL, then save. Navigate to your new compare page using the URL you entered. If you haven’t “flagged” any products yet, go do so and once done you should see those products displayed on your Compare Products page!!!
But, there is one slight issue. Because we needed to use Style: Table to get the layout to better suit a compare list, it still doesn’t display it the way we need it too. We want to display each of the products horizontally, with each field label shown on the far left so it is easy to compare our products. To do this we need to retheme the table style for our view.
Step 4. Theme the table output of the view
Under Theme: Information for our view, it displays a list of all the possible templates for the display plugin and for the style plugins. Look for the list titled Style output. This is what we want. It lists the possible templates we can use to change the theming of the style output. The first one it displays is the generic template for the table style output but we don’t want to use this one, because if we do we could effect any other table style view that may be on the site. So best to use the next one across, mine was called views-view-table–flag-compare.tpl.php.
Create a new php file and name the file to the template name you want to use. In my case my file is named views-view-table–flag-compare.tpl.php.
Paste the Drupal 6 code from here http://drupal.org/node/174578 into your template file.
Then place the file in your themes directory – and presto! Your comparison table should be laid out more like a comparison style grid. Below is a screenshot of what my Comparison page looks like after a little bit of extra styling.
Try this module: https://drupal.org/project/comparison
Allows the comparison of the attributes of two or more nodes by generating a table. A checkbox is added to nodes to allow them to be included in the comparison. If two or more nodes are selected a link is added to a page with a comparison table.

finding client ID's of table of listview webpart

short: A listview webpart contains a table with an ID composed of two GUID's, how do I find these?
I am working on adding some additional behaviour to a standard sharepoint listview-webpart.
Preferably I don't want to actually edit the webpart itself. I want to put javascript in a helper webpart to add some onclick events to the table rows which pass the values of the id and status columns to the helper webpart, which then displays some buttons depending on the row's status.
I searched around to see how others tackled this problem, and usually they use the webpart container div with ID WebPartWPQ _n_". The problem is that these webparts are going to be used on lots of sites, and I have no way of knowing the value of _n_.
A bit further down in the hierarchy is the main table of the view, and it also has an ID. In my test-case: {BF3FB0FA-7E7F-4920-A326-B5E46826B693}-{BD0777BD-455D-4554-A80E-8A11D990D1A5}
I figured these two guids must stand for something and could possibly be looked up.
So I went on a search through Sharepoint Manager to try to find those GUIDs, but I can't find them. Neither is the list ID, nor the original View ID, nor the web ID or the site ID.
So my question: Does anybody know what these ID's stand for, and how I can find them with my webpart code?
Have you considered using XSLT to customize the output of the webpart? You could then customize the output HTML and include any identifiers you wish so that you could reference them in your javascript. This is a pretty good description of how to do this: Overriding the presentation of an XSLT List View Web Part.

SharePoint Multiple New Item Forms

I've got a custom list with a custom content type. I'm aware that when you create a new item you can see a drop down for the different content types on that list which I assume all have their own NewForm.aspx somewhere. I can specify in the content type definition which columns are shown on the New form and that I can replace the new form with a custom one of my own design.
What I'm trying to achieve is to have multiple New forms but for the same content type listed on the New drop down. I would like each new form to expose different fields of the content type. Additionally I'd like to make particular New forms only visable by users with particular permissions although this isn't critical.
Scenario:
I've got a content type with all the fields I need for a risk assessment. When a new item is created it only exposes fields to enter contact details. Once this is created a workflow with infopath forms then drives the gathering of the rest of the risk assessment information through booking, the inspection itself and approval of the data. I want the ability to have a second option to easily enter all this information on a different new form for an inspection that's already been done and needs logging in the system.
You could customize the NewForm.aspx (e.g. via SharePoint Designer) for the initial submission case. Obviously, all of the required fields will need to be populated in some fashion.
The EditForm.aspx is the out-of-box page for updating existing list items. You may be able to customize this to meet your update an existing risk assessment case. From the post above it's not entirely clear to me whether this distinction between these pages is fully understood.
In both of these cases, you can add code-behind to the .aspx pages. However, it's usually best to start as simply as possible, keep it as simple as possible and only add complexity as necessary.
Hope this makes sense and helps. Good luck!
Dan,
Per your scenario, I have done something similar by creating one content type per actor/stage. Consider using a simple SharePoint Designer workflow to change your content types onChanged (simply by setting the Content Type) column so that the perspective actors only see the columns you want them to see in the edit/newforms. As long as the proper content type is set, your users will only see the fields you want them to see. Furthermore, with creative use of views and audience targetting of pages you can somewhat prevent these users from seeing columns.
Also, you can prevent users from seeing the different content types (under the new button) in the advanced content type page.

Resources