What is the difference between a Data Definition and a Data Definition Block?

voltmer1's Avatar

voltmer1

30 Jun, 2016 03:17 PM

I am trying to understand how the fields of a Data Definition, contained in a Configuration Set and applied to a page are displayed within the page and where? It seems that a Data Definition "block" would just be applied to a region of a page or template with a format, but how is the region defined for a standard Data Definition?

  1. 1 Posted by Ryan Griffith on 30 Jun, 2016 04:55 PM

    Ryan Griffith's Avatar

    Hi,

    Similar to the Structured Data Block, you would simply add a Format to the desired region that uses the calling page's structured data. To access this data, you can use the $currentPage variable that is available within Velocity Formats, or apply a calling page Index Block to the region and use an XSLT Format or a Velocity Format (and the XPath Tool).

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by voltmer1 on 30 Jun, 2016 05:03 PM

    voltmer1's Avatar

    So, what determines where the field data created within the Data Definition (within the Configuration Set) is outputted on a page based off of that configuration set? Does it just automatically go to the default region?

  3. 3 Posted by Wing Ming Chan on 01 Jul, 2016 11:58 AM

    Wing Ming Chan's Avatar

    Hi,

    If you understand the MVC architecture, it would be easy to explain.

    When you create a page for your organization, you need to gather proprietary data, integrate your business logic, and transform the data into a presentable form with your own styles. Cascade provides you a means to gather proprietary data, namely, the data definition associated with a content type. But the data itself won't do any good without business logic and presentation. Consider a datetime or a calendar. Cascade won't know what to do with the data collected. Instead, you want to have full control on your business logic and ways of presentation. That's why Cascade won't provide you anything other than collecting the data for you. This is very much expected. Therefore, you create a data definition and associate it with a content type. The data is collected in the GUI. Then you need to make the XML data available to the DEFAULT region. You achieve that by attaching the calling-page index block to the region, so that you can transform the data, and apply your styles to the data.

    Don't be fooled by the order or sequence of fields of the data definiton. You can in fact move things around, or wrap them up in server-side scripting code. I use only the DEFAULT region in my template to create everything, including branding information, breadcrumbs, the menu bar, the left nav, the right column, the footer, etc.

    If you want to move away from MVC, then use the XHTML page type, the one without a data definition. Then you will have all the data presented as is on the page. The data will come from a single WYSIWYG.

    Wing

  4. 4 Posted by Ryan Griffith on 01 Jul, 2016 12:10 PM

    Ryan Griffith's Avatar

    Hi,

    As Wing mentioned, the Data Definition is just a means of collecting the data, what determines where your Data Definition field(s) go are your region assignments (i.e. Blocks and Formats). The DEFAULT region is just a region which Cascade requires in order to ensure there is some content on the page, you don't necessarily have to output everything in that region.

    For example, you may have a SIDEBAR region that has a Format which outputs some data from a Sidebar group in your Data Definition, or you might have an ABOVE DEFAULT region that outputs some WYSIWYG content from a specific field.

    Please let me know if you have any questions.

    Thanks!

  5. 5 Posted by voltmer1 on 01 Jul, 2016 12:50 PM

    voltmer1's Avatar

    Thanks Guys!
    So, Cascade is actually using the MVC model with Java. I understand the MVC, so Wing's explanation is great. We are preparing to implement Cascasde for our College's website and I am the staff web developer, so I am trying to understand ever element of Cascade I can. I appreciate your help!

    Why does Cascade have Default Above and Below? Why not just let the user define additional regions in the template? And that begin said why even have a "Default Region" if you still have to assign a calling page to it to get any data output, doesn't make sense. Now, it it automatically pulled content into that region, that would truly be a default by meaning. But as you said, the data definition is just the method to collect the page data and wouldn't do anything without a view or controller (template & format).

  6. 6 Posted by Ryan Griffith on 01 Jul, 2016 07:51 PM

    Ryan Griffith's Avatar

    Hi,

    Why does Cascade have Default Above and Below?

    Region names are completely arbitrary and up to how the client implements their Template. The only requirements are that the Template content is valid XML and it contains at least a DEFAULT region. The main reason for this is to ensure valid XML is present during the rendering process.

    And that begin said why even have a "Default Region" if you still have to assign a calling page to it to get any data output, doesn't make sense. Now, it it automatically pulled content into that region, that would truly be a default by meaning.

    The DEFAULT region is slightly different from other regions in that without a Block assignment, the region is given access to the page's Structured Data (i.e. Data Definition content). If you need more that that, you need to either apply a Block or use a Velocity Format and the Cascade API (e.g. $currentPage variable) or Locator Tool

    Please let me know if you have any questions.

    Thanks!

  7. Tim closed this discussion on 29 Jul, 2016 08:30 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM