27
BY LISA HALL PITFALLS FOR CASCADE NEWBIES

Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

Embed Size (px)

Citation preview

Page 1: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

BY L I SA HALL

PITFALLS FOR CASCADE NEWBIES

Page 2: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

AGENDA/OUTLINE

• 6 Potential Pitfalls

• Top Data Definition creation Pitfall

• Top CSS Pitfall

• Top 2 - Format/Velocity Pitfall

• Top Page Data Definition Pitfall

• The Most Dangerous Pitfall of All

• Content Render Times - Efficiency

Page 3: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

DATA DEFINITION

• Content Render Depth

Page 4: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

CSS/FILES

2 STEPS

• [system-asset] tags

• Check „Rewrite page links‟

Page 5: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall
Page 6: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

Incorrect path to Current Page Node -

#set($page = $_XPathTool.selectSingleNode ($contentRoot,

“index-page/calling-system/page-system/”)

Directions: Unscramble and Re-order the path above

‘SOLVE THE PATH’

Page 7: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

Correct path to Current Page Node -

#set($data = $_XPathTool.selectSingleNode($contentRoot,

“system-index-block/calling-page/system-page/”)

SOLUTION

Page 8: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

In addition to incorrect Path names, another

common format issue is assigning values.

String#set($item1 = $_XPathTool.selectSingleNode($page, "name").value)

Node #set($item2 = $_XPathTool.selectSingleNode($page, "name"))

FORMATS-SCRIPTS

Page 9: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall
Page 10: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

Q1. Which item should be displayed here?

$_SerializerTool.serialize(“?")

#set($item1 = $_XPathTool.selectSingleNode($page,"name").value)

#set($item2 = $_XPathTool.selectSingleNode($page, "name"))

POP QUIZ

Page 11: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

Q2. What will each of these display?

<h1>$item1</h1>

<h1>$item2</h1>

#set($item1 = $_XPathTool.selectSingleNode($page,"name").value)

#set($item2 = $_XPathTool.selectSingleNode($page, "name"))

POP QUIZ

Page 12: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

Background images from your CSS file not displaying

properly?

TIDY UP…?

Page 13: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

• Page-level

• Admin -level

…OR NOT

TWO OPT IONS

Page 14: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

D O N ‟ T L E T T H I S H A P P E N T O Y O U !

Page 15: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

…BUT IF IT DOES

Go Back!!!

Page 16: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

EFFICIENT RENDERING TIMES

Why should you care?

Page 17: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

XML OUTPUT

<calling-page>

<system-page>

<dynamic-metadata>

<name>topic</name>

<value>Cascade Pitfalls</value>

</dynamic-metadata>

<dynamic-metadata>

<name>speaker</name>

<value>Lisa</value>

</dynamic-metadata>

Page 18: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

A C O M M O N A P P R O A C H

FORMATS - ADVANCED

Page 19: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

A COMMON APPROACH - CONT.

#foreach($metadata in $dynamic-metadata)

#if(metadata.getChild("name") =="speaker")

#set($item = metadata.getChild("value").value)

#end

Page 20: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

A BETTER WAY

Efficient Programming:

#set($item = $_XPathTool.selectNode($page,

"dynamic-metadata[name='speaker']/value").value)

Page 21: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

METRICS TO THE RESCUE!

TWO OPT IONS

Page 22: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

INDEX BLOCKS WEIGHING YOU DOWN?

Page 23: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

S M A L L E R I N D E X B L O C K S = F A S T E R R E N D E R I N G T I M E S

THERE, THAT’S BETTER

Page 24: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

T H E S K Y I S T H E L I M I T O N M A X A S S E T S

WAYS TO CREATE SMALLER BLOCKS

Page 25: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

IS THAT INLINE XML REALLY NECESSARY?

Page 26: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

QUESTIONS?

Page 27: Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall

IMAGE RESOURCES

http://blog.copdfoundation.org/questions-about-

insurance/c-users-sschlegel-pictures-question-mark-man/

http://www.instantlyfallasleep.com/looping-

dream.html