Shorten title on item browse page

Hi everyone,

I have been having difficulty shortening the link to my items on the public Item Browse page. I have successfully shortened the description that is displayed, but I receive errors when altering this piece in: Applications/Views/Scripts/Items

<?php foreach (loop('items') as $item): ?>
<div class="item hentry">
<h2><?php echo link_to_item(metadata('item', array('Dublin Core', 'Title')), array('class'=>'permalink')); ?></h2>
<div class="item-meta">
<?php if (metadata('item', 'has thumbnail')): ?>
<div class="item-img">
<?php echo link_to_item(item_image('square_thumbnail')); ?>
</div>
<?php endif; ?>

Can anyone offer advice for version 2.0.4? I'd really appreciate it.
Thanks!

Could you tell us what, exactly the error is, and guide us to what changes you are making to that piece of the code?

Also, it is always better to avoid modifying the core files. See this guide for how to customize theme files.

Thanks for responding!

I've tried a number of things, but adding this seemed pretty simple to me: array('snippet'=>150)
But I get a white page that says there is an unexpected "," or ";" or ")" on the line that I edited. Also, the word "array" appends itself onto the end of the Dublin Core title in some cases.

This is one example that I've tried:

<?php foreach (loop('items') as $item): ?>
<div class="item hentry">
<h2><?php echo link_to_item(metadata('item', array('Dublin Core', 'Title')), array('class'=>'permalink')), array('snippet'=>150); ?></h2>
<div class="item-meta">
<?php if (metadata('item', 'has thumbnail')): ?>
<div class="item-img">
<?php echo link_to_item(item_image('square_thumbnail')); ?>
</div>
<?php endif; ?>

Also, thank you for the guide. I'll have to take a look.

I tried this out, and it looks like just a problem of unclosed parens around one or more of the function calls, and unclosed PHP loops.

Some code editors can help you identify those kinds of problems. Komodo is a popular one, I think.

Other forums focused on PHP development in general might guide you toward editors or techniques for PHP debugging that can also help.

We can address Omeka-specific questions here, but not general PHP issues.

Thanks for looking into my problem. I tried many code editors and they show no syntax errors so this is strange.. I'll tinker some more, but thanks for your help.