Forums » Does Exhibit Builder's Caption Feature Support PHP

RSS feed for this topic

Info

  1. I'm trying to add captions to some images in Exhibit Builder. Instead of typing in the separate title for each image, I'd rather use something like <?php echo item('Dublin Core', 'Title'); ?>, so I could just copy and paste that to each image's caption. However I'm not having any success. If the caption feature does not support PHP, what file(s) should I edit manually to make this change?

  2. The captions are just text boxes that use TinyMCE to allow for some formatting of the text: http://omeka.org/codex/Using_HTML_Editor-TinyMCE

    Are you interested in getting rid of the captions all together and just generating a title?

    The exhibit builder's page functions are found here: yourinstallation/plugins/ExhibitBuilder/helpers/ExhibitPageFunctions.php)

    You might try removing the php call for a caption on the public layout pages and echo the DC title instead: plugins/ExhibitBuilder/views/shared/exhibit_layouts

  3. Thanks Sheila. I've edited the exhibit_builder_display_exhibit_thumbnail_gallery function in the ExhibitFunctions.php helper file. It now includes the line: $html .= link_to_item(item('Dublin Core', 'Title'), array('class'=>'permalink'));. I know in the main Omeka framework it's best not to edit helper files, so I was wondering if there is a custom.php functionality to the Exhibit Builder plugin.
    Thanks again,
    Andy

  4. This discussion is very helpful to me. I tried both techniques successfully (editing the exhibit_builder_display_exhibit_thumbnail_gallery function and adding a new exhibit layout template, each including Dublin Core data automatically). However, I'm wondering if it's possible to do something similar in place of the text area instead of the caption. I'd like to automatically place the DC title and description where the text area goes (rather than in the caption area). However, when I try to add to or replace the text area, it causes an error - I think something to do with the fact that there's an if statement regarding the text.

    So, for example this works:

    <div class="image-list-left">
    	<?php
    	for ($i=1; $i <= 8; $i++):
    	if(($text = exhibit_builder_page_text($i)) || exhibit_builder_use_exhibit_page_item($i)): ?>
    
    	<div class="image-text-group">
    
    	    <?php if($text): ?>
            <div class="exhibit-text">
                <?php echo $text; ?>
            </div>
    		<?php endif; ?>
    		<?php if(exhibit_builder_use_exhibit_page_item($i)):?>
    	    <div class="exhibit-item">
    			<?php echo exhibit_builder_exhibit_display_item(array('imageSize'=>'fullsize'), array('class'=>'permalink')); ?>
    			<?php echo item('Dublin Core', 'Title'); ?>
    			<?php echo item('Dublin Core', 'Description'); ?>
    	    </div>
    		<?php endif; ?>
    	</div>
    	<?php endif; endfor;?>
    </div>

    but this doesn't:

    <div class="image-list-left">
    	<?php
    	for ($i=1; $i <= 8; $i++):
    	if(($text = exhibit_builder_page_text($i)) || exhibit_builder_use_exhibit_page_item($i)): ?>
    
    	<div class="image-text-group">
    
            <div class="exhibit-text">
                <?php echo item('Dublin Core', 'Title'); ?>
    	    	<?php echo item('Dublin Core', 'Description'); ?>
            </div>
    		<?php if(exhibit_builder_use_exhibit_page_item($i)):?>
    	    <div class="exhibit-item">
    			<?php echo exhibit_builder_exhibit_display_item(array('imageSize'=>'fullsize'), array('class'=>'permalink')); ?>
    			<?php echo exhibit_builder_exhibit_display_caption($i); ?>
    	    </div>
    		<?php endif; ?>
    	</div>
    	<?php endif; endfor;?>
    </div>

    Is there a way to make this work?

    If not, another solution might work for my particular exhibition, which I'll put in another post . . .

    Thanks!
    Arden

Reply

You must log in to post.