Custom content

Topics: Customizing Orchard
Jun 28, 2012 at 10:03 AM

Hey everyone,

I'm looking for a way to create custom content with the help of jquery ui

This is what I want to display on the frontend:

  • Title1
  • Title2
  • Title3

Title1

text1text1text1text1text1text1text1text1text1

text1text1text1text1text1text1text1text1text1

So when you click on Title 1 you see the text for that item.

With jquery accordion this is fairly easy.

Now my question is, how can I create something in the backend so that the editors of the site can input Titles and per title some text and then render it on the foreend with jquery?

Tx,

Borrie

Developer
Jun 28, 2012 at 1:18 PM

What you could do is create a new Content Type called "Title" (or maybe something more specific). This Title content type would have at least two parts: TitlePart and BodyPart. Now your editors will be able to create new Titles.

Next, make sure you installed and enabled the Projections module and create a Query and a Projection that uses that query and define a Layout for the query (or projection, not sure from the top of my head).

Create an Alternate for your projection layout. Inside this alternate, you should be able to render anything you want, such as the jQuery Accordion.
If Alternates don't work for you, you could even go so far and introduce a new Layout (currently there is List and Grid).

Jun 28, 2012 at 2:18 PM

Skywalker,

Do you now if there is an existing tutorial on Projections? I can't seem to find it on the website.

Borrie

Developer
Jun 28, 2012 at 3:01 PM

Hi Borrie, the only one I could find is the one from David Hayden: http://www.davidhayden.me/blog/projector-module-in-orchard-cms. It's an excellent introduction that should help you get started.

Jun 28, 2012 at 3:17 PM

Skywalker,

Do you know how i Can create a new layout?

Borrie

Coordinator
Jun 28, 2012 at 9:19 PM

 

http://docs.orchardproject.net/Documentation/Orchard-TV#LivedemoofProjectorbySébastienRos