1

I'm new to Composite C1, and i am just playing around with it at the moment.. I have made some functions and some data types and my page sort of works.

I basically have:

Artist -

  1. Artist Name
  2. Artist Website
  3. Artist Bio

I've also then placed the function into the page so that once i upload some artists their info appears on the page, which is great. But i want to see how hard it'd be to make it so that you could click an artist name to view the full bio, and only have their name and photo on the initial page. Can i do this using basic functions and data types?

I've done some reading and i think 'Global Datatypes' is what i'd need to use (?)

Any help appeaciated

Gerico
  • 5,079
  • 14
  • 44
  • 85

1 Answers1

1

You can use global data types and page folder types - the latter would let you manage artists below the page that display them, while the former is great for data used across your website.

To have a page display a list by default and then a detail view when an item is clicked you need a function to do the job. The 'Visual Functions' feature (which let you create a rendering function in a WYSISYG way) cannot do this, but you can do it with 'Razor Functions', 'User Control Functions', 'XSLT Functions' or with ASP.NET MVC (using the MVC Player).

What ever technology you should choose the task is basically:

  • If no artist is selected in the URL, you show a list of artists. These link to the current page URL appended with some artist id.
  • If you are called with an ID, you do not render the list, but render the detail view.

The way you pass the artist id in the URL is up to you. You can use query string like 'Artists?id=(some id)' or you can use path info like 'Artists/(some id)'. You can choose to identify data by the 'Id' field (GUID) the data type already have or you can opt for a string field you then keep unique, like 'Artist Name'. The former ensures uniqueness, the latter ensure URLs that are seo and human friendly.

On the Composite C1 documentation site you can find guides on creating 'list to detail' functions in Composite C1:

mawtex
  • 436
  • 1
  • 4
  • 11
  • Brilliant thank you! - Ive manged to create a test function, although the one in the example doesn't work for me, which is a bummer. It lists the pages ok, but clicking only causes an error :( – Gerico May 13 '13 at 20:57