tag:help-archives.hannonhill.com,2010-02-09:/discussions/general/18741-way-to-determine-pages-title-lengthCascade CMS: Discussion 2014-09-03T19:49:02Ztag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T14:30:03Z2014-08-15T14:30:03ZWay to determine pages' title length<div><p>This will be a good candidate for my <code>Report</code> class.
We just need to look at the title field and count the number of
characters, and report a page if the number exceeds a predefined
max.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T14:39:36Z2014-08-15T14:39:36ZWay to determine pages' title length<div><p>Also, depending on your needs, you could adjust your Velocity
Format to pass the title string through the <a href=
"http://www.hannonhill.com/kb/Script-Formats/#display-tool">Display
Tool's truncate method</a>. This would allow you to control the
length of the title based on either characters or words as well as
append something onto the end, such as ellipses.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T14:39:36Z2014-08-15T14:39:36ZWay to determine pages' title length<div><p>Also, depending on your needs, you could adjust your Velocity
Format to pass the title string through the <a href=
"http://www.hannonhill.com/kb/Script-Formats/#display-tool">Display
Tool's truncate method</a>. This would allow you to control the
length of the title based on either characters or words as well as
append something onto the end, such as ellipses.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T14:40:45Z2014-08-15T14:40:45ZWay to determine pages' title length<div><p>Can you tell me about this Report class? Is this something I can
use now or is it in a newer update?</p></div>matthew.wrentag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T15:20:48Z2014-08-15T15:23:59ZWay to determine pages' title length<div><p>I have just added a <code>reportLongTitle</code> method to the
<a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/generating-reports/report.php">
Report</a> class. To generate such a report, use code of the
following type:<br></p>
<pre>
$site_name = 'about';
$folder_path = '/';
$max = 40;
$results = $report->
setRootContainer(
$cascade->getAsset(
Folder::TYPE, $folder_path, $site_name )
)->reportLongTitle( $max );
DebugUtility::dump( $results );
</pre>
Wing</div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T18:02:27Z2014-08-15T18:02:27ZWay to determine pages' title length<div><p>Where do I need to go to generate this report?</p></div>matthew.wrentag:help-archives.hannonhill.com,2010-02-09:Comment/341558412014-08-15T18:25:15Z2014-08-18T19:50:02ZWay to determine pages' title length<div><p>Matt,</p>
<p>You will need to set up the library first, if you haven't. Try
these steps:</p>
<ol>
<li>Download the library cascade_ws.zip on <a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/classes/index.php">
Building Classes</a><br></li>
<li>Install and configure the library: <a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/classes/how-to-use-library.php">
How to Use the Library</a><br></li>
<li>Put the code in one of your test pages and load the page in a
browser.</li>
</ol>
<p>Updated: see <a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/generating-reports/working-with-wired-fields.php">
Working With Wired Fields of Metadata</a>.</p>
<p>Wing</p></div>Wing Ming Chan